TaskList: merge into project explorer plugin

Change-Id: I6097f3ea40a6a7c3ced0f59b15789046184e2e90
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
David Schulz
2022-06-21 13:15:05 +02:00
parent c4e94c2c9c
commit dacb4ec82d
17 changed files with 159 additions and 450 deletions

View File

@@ -24,7 +24,6 @@ add_subdirectory(bookmarks)
add_subdirectory(cppeditor)
add_subdirectory(help)
add_subdirectory(resourceeditor)
add_subdirectory(tasklist)
add_subdirectory(nim)
add_subdirectory(conan)

View File

@@ -75,7 +75,6 @@ Project {
"silversearcher/silversearcher.qbs",
"studiowelcome/studiowelcome.qbs",
"subversion/subversion.qbs",
"tasklist/tasklist.qbs",
"texteditor/texteditor.qbs",
"todo/todo.qbs",
"updateinfo/updateinfo.qbs",

View File

@@ -171,6 +171,7 @@ add_qtc_plugin(ProjectExplorer
targetsetuppage.cpp targetsetuppage.h
targetsetupwidget.cpp targetsetupwidget.h
task.cpp task.h
taskfile.cpp taskfile.h
taskhub.cpp taskhub.h
taskmodel.cpp taskmodel.h
taskwindow.cpp taskwindow.h

View File

@@ -34,5 +34,17 @@
\"Description\" : \"Restore a saved session\"
}
],
$$dependencyList
$$dependencyList,
\"Mimetypes\" : [
\"<?xml version=\'1.0\' encoding=\'UTF-8\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
\" <mime-type type=\'text/x-tasklist\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Qt Creator task list file</comment>\",
\" <glob pattern=\'*.tasks\'/>\",
\" <glob pattern=\'*.tasks.txt\'/>\",
\" </mime-type>\",
\"</mime-info>\"
]
}

View File

@@ -92,6 +92,7 @@
#include "showineditortaskhandler.h"
#include "simpleprojectwizard.h"
#include "target.h"
#include "taskfile.h"
#include "taskhub.h"
#include "toolchainmanager.h"
#include "toolchainoptionspage.h"
@@ -532,6 +533,7 @@ public:
void currentModeChanged(Id mode, Id oldMode);
void updateWelcomePage();
void loadSesssionTasks();
void checkForShutdown();
void timerEvent(QTimerEvent *) override;
@@ -717,6 +719,8 @@ public:
DefaultDeployConfigurationFactory m_defaultDeployConfigFactory;
IDocumentFactory m_documentFactory;
IDocumentFactory m_taskFileFactory;
StopMonitoringHandler closeTaskFile;
DeviceTypeKitAspect deviceTypeKitAspect;
DeviceKitAspect deviceKitAspect;
@@ -872,10 +876,10 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
dd, &ProjectExplorerPluginPrivate::updateActions);
connect(sessionManager, &SessionManager::sessionLoaded,
dd, &ProjectExplorerPluginPrivate::updateActions);
connect(sessionManager,
&SessionManager::sessionLoaded,
dd,
&ProjectExplorerPluginPrivate::updateWelcomePage);
connect(sessionManager, &SessionManager::sessionLoaded,
dd, &ProjectExplorerPluginPrivate::updateWelcomePage);
connect(sessionManager, &SessionManager::sessionLoaded,
dd, &ProjectExplorerPluginPrivate::loadSesssionTasks);
connect(sessionManager, &SessionManager::projectAdded, dd, [](ProjectExplorer::Project *project) {
dd->m_allProjectDirectoriesFilter.addDirectory(project->projectDirectory().toString());
@@ -2242,6 +2246,11 @@ void ProjectExplorerPlugin::extensionsInitialized()
dd->m_profileMimeTypes += mimeType;
}
dd->m_taskFileFactory.addMimeType("text/x-tasklist");
dd->m_taskFileFactory.setOpener([](const FilePath &filePath) {
return TaskFile::openTasks(filePath);
});
QString allProjectsFilter = tr("All Projects");
allProjectsFilter += QLatin1String(" (") + allGlobPatterns.join(QLatin1Char(' '))
+ QLatin1Char(')');
@@ -2251,6 +2260,7 @@ void ProjectExplorerPlugin::extensionsInitialized()
BuildManager::extensionsInitialized();
TaskHub::addCategory(Constants::TASK_CATEGORY_SANITIZER,
tr("Sanitizer", "Category for sanitizer issues listed under 'Issues'"));
TaskHub::addCategory(Constants::TASK_CATEGORY_TASKLIST_ID, tr("My Tasks"));
SshSettings::loadSettings(Core::ICore::settings());
const auto searchPathRetriever = [] {
@@ -2594,6 +2604,14 @@ void ProjectExplorerPluginPrivate::updateWelcomePage()
m_welcomePage.reloadWelcomeScreenData();
}
void ProjectExplorerPluginPrivate::loadSesssionTasks()
{
const FilePath filePath = FilePath::fromVariant(
SessionManager::value(Constants::SESSION_TASKFILE_KEY));
if (!filePath.isEmpty())
TaskFile::openTasks(filePath);
}
void ProjectExplorerPluginPrivate::currentModeChanged(Id mode, Id oldMode)
{
if (oldMode == Constants::MODE_SESSION) {

View File

@@ -145,6 +145,7 @@ Project {
"targetsetuppage.cpp", "targetsetuppage.h",
"targetsetupwidget.cpp", "targetsetupwidget.h",
"task.cpp", "task.h",
"taskfile.cpp", "taskfile.h",
"taskhub.cpp", "taskhub.h",
"taskmodel.cpp", "taskmodel.h",
"taskwindow.cpp", "taskwindow.h",

View File

@@ -132,6 +132,7 @@ const char TASK_CATEGORY_BUILDSYSTEM[] = "Task.Category.Buildsystem";
const char TASK_CATEGORY_DEPLOYMENT[] = "Task.Category.Deploy";
const char TASK_CATEGORY_AUTOTEST[] = "Task.Category.Autotest";
const char TASK_CATEGORY_SANITIZER[] = "Task.Category.Analyzer";
const char TASK_CATEGORY_TASKLIST_ID[] = "Task.Category.TaskListId";
// Wizard categories
const char QT_PROJECT_WIZARD_CATEGORY[] = "H.Project";
@@ -239,6 +240,7 @@ const char LASTSESSION_KEY[] = "ProjectExplorer/StartupSession";
const char SETTINGS_MENU_HIDE_BUILD[] = "Menu/HideBuild";
const char SETTINGS_MENU_HIDE_DEBUG[] = "Menu/HideDebug";
const char SETTINGS_MENU_HIDE_ANALYZE[] = "Menu/HideAnalyze";
const char SESSION_TASKFILE_KEY[] = "TaskList.File";
// UI texts
PROJECTEXPLORER_EXPORT QString msgAutoDetected();

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
@@ -23,81 +23,91 @@
**
****************************************************************************/
#include "tasklistplugin.h"
#include "stopmonitoringhandler.h"
#include "taskfile.h"
#include "tasklistconstants.h"
#include <coreplugin/icore.h>
#include <coreplugin/idocumentfactory.h>
#include "projectexplorer.h"
#include "session.h"
#include "taskhub.h"
#include <coreplugin/documentmanager.h>
#include <projectexplorer/session.h>
#include <projectexplorer/task.h>
#include <projectexplorer/taskhub.h>
#include <coreplugin/icore.h>
#include <utils/algorithm.h>
#include <utils/fileutils.h>
#include <QDir>
#include <QAction>
#include <QMessageBox>
#include <QStringList>
using namespace Core;
using namespace ProjectExplorer;
using namespace Utils;
static const char SESSION_FILE_KEY[] = "TaskList.File";
namespace TaskList {
namespace ProjectExplorer {
namespace Internal {
static TaskListPlugin *m_instance;
// --------------------------------------------------------------------------
// TaskFile
// --------------------------------------------------------------------------
class TaskListPluginPrivate
QList<TaskFile *> TaskFile::openFiles;
TaskFile::TaskFile(QObject *parent) : Core::IDocument(parent)
{
public:
QList<TaskFile *> m_openFiles;
Core::IDocumentFactory m_fileFactory;
StopMonitoringHandler m_stopMonitoringHandler;
};
setId("TaskList.TaskFile");
}
Core::IDocument::ReloadBehavior TaskFile::reloadBehavior(ChangeTrigger state, ChangeType type) const
{
Q_UNUSED(state)
Q_UNUSED(type)
return BehaviorSilent;
}
bool TaskFile::reload(QString *errorString, ReloadFlag flag, ChangeType type)
{
Q_UNUSED(flag)
if (type == TypeRemoved) {
deleteLater();
return true;
}
return load(errorString, filePath());
}
static Task::TaskType typeFrom(const QString &typeName)
{
Task::TaskType type = Task::Unknown;
QString tmp = typeName.toLower();
if (tmp.startsWith(QLatin1String("warn")))
type = Task::Warning;
else if (tmp.startsWith(QLatin1String("err")))
type = Task::Error;
return type;
if (tmp.startsWith("warn"))
return Task::Warning;
if (tmp.startsWith("err"))
return Task::Error;
return Task::Unknown;
}
static QStringList parseRawLine(const QByteArray &raw)
{
QStringList result;
QString line = QString::fromUtf8(raw.constData());
if (line.startsWith(QLatin1Char('#')))
if (line.startsWith('#'))
return result;
return line.split(QLatin1Char('\t'));
return line.split('\t');
}
static QString unescape(const QString &input)
{
QString result;
for (int i = 0; i < input.count(); ++i) {
if (input.at(i) == QLatin1Char('\\')) {
if (input.at(i) == '\\') {
if (i == input.count() - 1)
continue;
if (input.at(i + 1) == QLatin1Char('n')) {
result.append(QLatin1Char('\n'));
if (input.at(i + 1) == 'n') {
result.append('\n');
++i;
continue;
} else if (input.at(i + 1) == QLatin1Char('t')) {
result.append(QLatin1Char('\t'));
} else if (input.at(i + 1) == 't') {
result.append('\t');
++i;
continue;
} else if (input.at(i + 1) == QLatin1Char('\\')) {
result.append(QLatin1Char('\\'));
} else if (input.at(i + 1) == '\\') {
result.append('\\');
++i;
continue;
}
@@ -112,7 +122,7 @@ static bool parseTaskFile(QString *errorString, const FilePath &name)
{
QFile tf(name.toString());
if (!tf.open(QIODevice::ReadOnly)) {
*errorString = TaskListPlugin::tr("Cannot open task file %1: %2").arg(
*errorString = ProjectExplorerPlugin::tr("Cannot open task file %1: %2").arg(
name.toUserOutput(), tf.errorString());
return false;
}
@@ -155,78 +165,34 @@ static bool parseTaskFile(QString *errorString, const FilePath &name)
description = unescape(description);
TaskHub::addTask(Task(type, description, FilePath::fromUserInput(file), line,
Constants::TASKLISTTASK_ID));
Constants::TASK_CATEGORY_TASKLIST_ID));
}
return true;
}
// --------------------------------------------------------------------------
// TaskListPlugin
// --------------------------------------------------------------------------
IDocument *TaskListPlugin::openTasks(const FilePath &fileName)
static void clearTasks()
{
TaskFile *file = Utils::findOrDefault(d->m_openFiles, Utils::equal(&TaskFile::filePath, fileName));
QString errorString;
if (file) {
file->load(&errorString, fileName);
} else {
file = new TaskFile(this);
if (!file->load(&errorString, fileName)) {
QMessageBox::critical(ICore::dialogParent(), tr("File Error"), errorString);
delete file;
return nullptr;
}
d->m_openFiles.append(file);
// Register with filemanager:
DocumentManager::addDocument(file);
}
return file;
TaskHub::clearTasks(Constants::TASK_CATEGORY_TASKLIST_ID);
}
TaskListPlugin::TaskListPlugin()
void TaskFile::stopMonitoring()
{
m_instance = this;
SessionManager::setValue(Constants::SESSION_TASKFILE_KEY, {});
for (TaskFile *document : qAsConst(openFiles))
document->deleteLater();
openFiles.clear();
}
TaskListPlugin::~TaskListPlugin()
{
delete d;
m_instance = nullptr;
}
bool TaskListPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
Q_UNUSED(arguments)
Q_UNUSED(errorMessage)
d = new TaskListPluginPrivate;
//: Category under which tasklist tasks are listed in Issues view
TaskHub::addCategory(Constants::TASKLISTTASK_ID, tr("My Tasks"));
d->m_fileFactory.addMimeType(QLatin1String("text/x-tasklist"));
d->m_fileFactory.setOpener([this](const FilePath &filePath) {
return openTasks(filePath);
});
connect(SessionManager::instance(), &SessionManager::sessionLoaded,
this, &TaskListPlugin::loadDataFromSession);
return true;
}
bool TaskListPlugin::loadFile(QString *errorString, const FilePath &fileName)
bool TaskFile::load(QString *errorString, const FilePath &fileName)
{
setFilePath(fileName);
clearTasks();
bool result = parseTaskFile(errorString, fileName);
if (result) {
if (!SessionManager::isDefaultSession(SessionManager::activeSession()))
SessionManager::setValue(QLatin1String(SESSION_FILE_KEY), fileName.toString());
SessionManager::setValue(Constants::SESSION_TASKFILE_KEY, fileName.toVariant());
} else {
stopMonitoring();
}
@@ -234,27 +200,53 @@ bool TaskListPlugin::loadFile(QString *errorString, const FilePath &fileName)
return result;
}
void TaskListPlugin::stopMonitoring()
TaskFile *TaskFile::openTasks(const FilePath &filePath)
{
SessionManager::setValue(QLatin1String(SESSION_FILE_KEY), QString());
TaskFile *file = Utils::findOrDefault(openFiles, Utils::equal(&TaskFile::filePath, filePath));
QString errorString;
if (file) {
file->load(&errorString, filePath);
} else {
file = new TaskFile(ProjectExplorerPlugin::instance());
foreach (TaskFile *document, m_instance->d->m_openFiles)
document->deleteLater();
m_instance->d->m_openFiles.clear();
if (!file->load(&errorString, filePath)) {
QMessageBox::critical(Core::ICore::dialogParent(), tr("File Error"), errorString);
delete file;
return nullptr;
}
openFiles.append(file);
// Register with filemanager:
Core::DocumentManager::addDocument(file);
}
return file;
}
void TaskListPlugin::clearTasks()
bool StopMonitoringHandler::canHandle(const ProjectExplorer::Task &task) const
{
TaskHub::clearTasks(Constants::TASKLISTTASK_ID);
return task.category == Constants::TASK_CATEGORY_TASKLIST_ID;
}
void TaskListPlugin::loadDataFromSession()
void StopMonitoringHandler::handle(const ProjectExplorer::Task &task)
{
const FilePath fileName = FilePath::fromString(
SessionManager::value(QLatin1String(SESSION_FILE_KEY)).toString());
if (!fileName.isEmpty())
openTasks(fileName);
QTC_ASSERT(canHandle(task), return);
Q_UNUSED(task)
TaskFile::stopMonitoring();
}
QAction *StopMonitoringHandler::createAction(QObject *parent) const
{
const QString text =
QCoreApplication::translate("TaskList::Internal::StopMonitoringHandler",
"Stop Monitoring");
const QString toolTip =
QCoreApplication::translate("TaskList::Internal::StopMonitoringHandler",
"Stop monitoring task files.");
auto stopMonitoringAction = new QAction(text, parent);
stopMonitoringAction->setToolTip(toolTip);
return stopMonitoringAction;
}
} // namespace Internal
} // namespace TaskList
} // namespace ProjectExplorer

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
@@ -25,13 +25,21 @@
#pragma once
#include "itaskhandler.h"
#include <coreplugin/idocument.h>
namespace ProjectExplorer { class Project; }
namespace TaskList {
namespace ProjectExplorer {
namespace Internal {
class StopMonitoringHandler : public ITaskHandler
{
public:
bool canHandle(const ProjectExplorer::Task &) const override;
void handle(const ProjectExplorer::Task &) override;
QAction *createAction(QObject *parent) const override;
};
class TaskFile : public Core::IDocument
{
public:
@@ -41,7 +49,13 @@ public:
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
bool load(QString *errorString, const Utils::FilePath &fileName);
static TaskFile *openTasks(const Utils::FilePath &filePath);
static void stopMonitoring();
private:
static QList<TaskFile *> openFiles;
};
} // namespace Internal
} // namespace TaskList
} // namespace ProjectExplorer

View File

@@ -1,8 +0,0 @@
add_qtc_plugin(TaskList
PLUGIN_DEPENDS Core ProjectExplorer
SOURCES
stopmonitoringhandler.cpp stopmonitoringhandler.h
taskfile.cpp taskfile.h
tasklistconstants.h
tasklistplugin.cpp tasklistplugin.h
)

View File

@@ -1,30 +0,0 @@
{
\"Name\" : \"TaskList\",
\"Version\" : \"$$QTCREATOR_VERSION\",
\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\",
\"Vendor\" : \"The Qt Company Ltd\",
\"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\",
\"License\" : [ \"Commercial Usage\",
\"\",
\"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and The Qt Company.\",
\"\",
\"GNU General Public License Usage\",
\"\",
\"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\"
],
\"Description\" : \"Use .tasks-files to populate the Issues view.\",
\"Url\" : \"http://www.qt.io\",
$$dependencyList,
\"Mimetypes\" : [
\"<?xml version=\'1.0\' encoding=\'UTF-8\'?>\",
\"<mime-info xmlns=\'http://www.freedesktop.org/standards/shared-mime-info\'>\",
\" <mime-type type=\'text/x-tasklist\'>\",
\" <sub-class-of type=\'text/plain\'/>\",
\" <comment>Qt Creator task list file</comment>\",
\" <glob pattern=\'*.tasks\'/>\",
\" <glob pattern=\'*.tasks.txt\'/>\",
\" </mime-type>\",
\"</mime-info>\"
]
}

View File

@@ -1,67 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "stopmonitoringhandler.h"
#include "tasklistconstants.h"
#include "tasklistplugin.h"
#include <projectexplorer/task.h>
#include <utils/qtcassert.h>
#include <QAction>
#include <QCoreApplication>
using namespace TaskList;
using namespace TaskList::Internal;
// --------------------------------------------------------------------------
// StopMonitoringHandler
// --------------------------------------------------------------------------
bool StopMonitoringHandler::canHandle(const ProjectExplorer::Task &task) const
{
return task.category == Constants::TASKLISTTASK_ID;
}
void StopMonitoringHandler::handle(const ProjectExplorer::Task &task)
{
QTC_ASSERT(canHandle(task), return);
Q_UNUSED(task)
TaskListPlugin::stopMonitoring();
}
QAction *StopMonitoringHandler::createAction(QObject *parent) const
{
const QString text =
QCoreApplication::translate("TaskList::Internal::StopMonitoringHandler",
"Stop Monitoring");
const QString toolTip =
QCoreApplication::translate("TaskList::Internal::StopMonitoringHandler",
"Stop monitoring task files.");
auto stopMonitoringAction = new QAction(text, parent);
stopMonitoringAction->setToolTip(toolTip);
return stopMonitoringAction;
}

View File

@@ -1,42 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <projectexplorer/itaskhandler.h>
namespace TaskList {
namespace Internal {
class StopMonitoringHandler : public ProjectExplorer::ITaskHandler
{
public:
bool canHandle(const ProjectExplorer::Task &) const override;
void handle(const ProjectExplorer::Task &) override;
QAction *createAction(QObject *parent) const override;
};
} // namespace Internal
} // namespace TaskList

View File

@@ -1,66 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "taskfile.h"
#include "tasklistplugin.h"
#include <utils/fileutils.h>
using namespace TaskList;
using namespace TaskList::Internal;
// --------------------------------------------------------------------------
// TaskFile
// --------------------------------------------------------------------------
TaskFile::TaskFile(QObject *parent) : Core::IDocument(parent)
{
setId("TaskList.TaskFile");
}
Core::IDocument::ReloadBehavior TaskFile::reloadBehavior(ChangeTrigger state, ChangeType type) const
{
Q_UNUSED(state)
Q_UNUSED(type)
return BehaviorSilent;
}
bool TaskFile::reload(QString *errorString, ReloadFlag flag, ChangeType type)
{
Q_UNUSED(flag)
if (type == TypeRemoved) {
deleteLater();
return true;
}
return load(errorString, filePath());
}
bool TaskFile::load(QString *errorString, const Utils::FilePath &fileName)
{
setFilePath(fileName);
return TaskListPlugin::loadFile(errorString, fileName);
}

View File

@@ -1,21 +0,0 @@
import qbs 1.0
QtcPlugin {
name: "TaskList"
Depends { name: "Qt.widgets" }
Depends { name: "Utils" }
Depends { name: "Core" }
Depends { name: "ProjectExplorer" }
files: [
"stopmonitoringhandler.cpp",
"stopmonitoringhandler.h",
"taskfile.cpp",
"taskfile.h",
"tasklistconstants.h",
"tasklistplugin.cpp",
"tasklistplugin.h",
]
}

View File

@@ -1,34 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
namespace TaskList {
namespace Constants {
const char TASKLISTTASK_ID[] = "TaskList.TaskListTaskId";
} // namespace Constants
} // namespace TaskList

View File

@@ -1,61 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <coreplugin/idocumentfactory.h>
#include <extensionsystem/iplugin.h>
namespace Utils { class FilePath; }
namespace TaskList {
namespace Internal {
class TaskListPlugin final : public ExtensionSystem::IPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "TaskList.json")
public:
TaskListPlugin();
~TaskListPlugin() final;
bool initialize(const QStringList &arguments, QString *errorMessage) override;
static bool loadFile(QString *errorString, const Utils::FilePath &fileName);
static void stopMonitoring();
static void clearTasks();
Core::IDocument *openTasks(const Utils::FilePath &fileName);
void loadDataFromSession();
private:
class TaskListPluginPrivate *d = nullptr;
};
} // namespace Internal
} // namespace TaskList