forked from qt-creator/qt-creator
Added a method to remove individual tasks from the task window.
This commit is contained in:
@@ -116,6 +116,7 @@ public:
|
|||||||
|
|
||||||
QList<Task> tasks(const QString &categoryId = QString()) const;
|
QList<Task> tasks(const QString &categoryId = QString()) const;
|
||||||
void addTask(const Task &task);
|
void addTask(const Task &task);
|
||||||
|
void removeTask(const Task &task);
|
||||||
void clearTasks(const QString &categoryId = QString());
|
void clearTasks(const QString &categoryId = QString());
|
||||||
|
|
||||||
int sizeOfFile();
|
int sizeOfFile();
|
||||||
@@ -253,15 +254,16 @@ void TaskModel::addTask(const Task &task)
|
|||||||
|
|
||||||
m_maxSizeOfFileName = qMax(m_maxSizeOfFileName, fm.width(filename));
|
m_maxSizeOfFileName = qMax(m_maxSizeOfFileName, fm.width(filename));
|
||||||
}
|
}
|
||||||
//
|
|
||||||
//void TaskModel::removeTask(const ITaskWindow::Task &task)
|
void TaskModel::removeTask(const Task &task)
|
||||||
//{
|
{
|
||||||
// Q_ASSERT(m_tasks.contains(task));
|
if (m_tasks.contains(task)) {
|
||||||
// int index = m_tasks.indexOf(task);
|
int index = m_tasks.indexOf(task);
|
||||||
// beginRemoveRows(QModelIndex(), index, index);
|
beginRemoveRows(QModelIndex(), index, index);
|
||||||
// m_tasks.removeAt(index);
|
m_tasks.removeAt(index);
|
||||||
// endRemoveRows();
|
endRemoveRows();
|
||||||
//}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TaskModel::clearTasks(const QString &categoryId)
|
void TaskModel::clearTasks(const QString &categoryId)
|
||||||
{
|
{
|
||||||
@@ -557,6 +559,15 @@ void TaskWindow::addTask(const Task &task)
|
|||||||
navigateStateChanged();
|
navigateStateChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TaskWindow::removeTask(const Task &task)
|
||||||
|
{
|
||||||
|
m_model->removeTask(task);
|
||||||
|
|
||||||
|
updateActions();
|
||||||
|
emit tasksChanged();
|
||||||
|
navigateStateChanged();
|
||||||
|
}
|
||||||
|
|
||||||
void TaskWindow::showTaskInFile(const QModelIndex &index)
|
void TaskWindow::showTaskInFile(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
|
@@ -99,6 +99,7 @@ public:
|
|||||||
void addCategory(const QString &categoryId, const QString &displayName);
|
void addCategory(const QString &categoryId, const QString &displayName);
|
||||||
|
|
||||||
void addTask(const Task &task);
|
void addTask(const Task &task);
|
||||||
|
void removeTask(const Task &task);
|
||||||
void clearTasks(const QString &categoryId = QString());
|
void clearTasks(const QString &categoryId = QString());
|
||||||
|
|
||||||
int taskCount(const QString &categoryId = QString()) const;
|
int taskCount(const QString &categoryId = QString()) const;
|
||||||
|
Reference in New Issue
Block a user