Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b6fac05be | |||
| b1a73990e6 |
@@ -30,7 +30,7 @@ namespace ProjectFilesystemPlugin {
|
||||
// Delete members
|
||||
}
|
||||
|
||||
bool ProjectFilesystemPluginPlugin::initialize(const QStringList &arguments, QString *errorString)
|
||||
Utils::Result<> ProjectFilesystemPluginPlugin::initialize(const QStringList &arguments)
|
||||
{
|
||||
// Register objects in the plugin manager's object pool
|
||||
// Load settings
|
||||
@@ -40,7 +40,6 @@ namespace ProjectFilesystemPlugin {
|
||||
// depends on have initialized their members.
|
||||
|
||||
Q_UNUSED(arguments)
|
||||
Q_UNUSED(errorString)
|
||||
|
||||
/*auto action = new QAction(tr("ProjectFilesystemPlugin Action"), this);
|
||||
Core::Command *cmd = Core::ActionManager::registerAction(action, Constants::ACTION_ID,
|
||||
@@ -57,12 +56,12 @@ namespace ProjectFilesystemPlugin {
|
||||
//addAutoReleasedObject(new ProjectFSWidgetFactory());
|
||||
(new ProjectFSWidgetFactory())->setParent(this);
|
||||
|
||||
return true;
|
||||
return Utils::ResultOk;
|
||||
}
|
||||
|
||||
void ProjectFilesystemPluginPlugin::extensionsInitialized()
|
||||
{
|
||||
Utils::globalMacroExpander()->registerPrefix("ProjectFilesystem", "Project filesystem plugin", [](QString v) -> QString {return v;} );
|
||||
Utils::globalMacroExpander()->registerPrefix("ProjectFilesystem", "ProjectFilesystem", "Project filesystem plugin", [](QString v) -> QString {return v;} );
|
||||
Utils::globalMacroExpander()->registerFileVariables("ProjectFilesystem", "Selected item",
|
||||
[]() -> Utils::FilePath { return Utils::FilePath::fromString(projectfs_menu_target.absoluteFilePath());}, true);
|
||||
// Retrieve objects from the plugin manager's object pool
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace ProjectFilesystemPlugin {
|
||||
ProjectFilesystemPluginPlugin();
|
||||
~ProjectFilesystemPluginPlugin();
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *errorString) override;
|
||||
Utils::Result<> initialize(const QStringList &arguments) override;
|
||||
void extensionsInitialized() override;
|
||||
ShutdownFlag aboutToShutdown() override;
|
||||
|
||||
|
||||
@@ -309,7 +309,7 @@ void ProjectFilesystemWidget::createProjectTree(void * p) {
|
||||
if (!p) return;
|
||||
ProjectExplorer::Project * pr = (ProjectExplorer::Project *)p;
|
||||
QTreeWidgetItem * ri = new QTreeWidgetItem();
|
||||
QString dir = pr->projectDirectory().toString();
|
||||
QString dir = pr->projectDirectory().toUrlishString();
|
||||
QFile logo(dir + "/logo.png");
|
||||
if (logo.exists())
|
||||
ri->setIcon(0, QIcon(logo.fileName()));
|
||||
@@ -341,7 +341,7 @@ void ProjectFilesystemWidget::filterClicked() {
|
||||
void ProjectFilesystemWidget::currentFileChanged() {
|
||||
Core::IDocument * cd = Core::EditorManager::instance()->currentDocument();
|
||||
if (!cd) return;
|
||||
QString np = cd->filePath().toString();
|
||||
QString np = cd->filePath().toUrlishString();
|
||||
QTreeWidgetItem * ti = item_map.value(np);
|
||||
if (!ti) return;
|
||||
tree->setCurrentItem(ti);
|
||||
@@ -357,7 +357,7 @@ void ProjectFilesystemWidget::startupProjectChanged() {
|
||||
QTreeWidgetItem * ti = tree->topLevelItem(i);
|
||||
ti->setFont(0, f);
|
||||
if (!sp) continue;
|
||||
if (sp->projectDirectory().toString() == ti->data(0, roleFullPath).toString())
|
||||
if (sp->projectDirectory().toUrlishString() == ti->data(0, roleFullPath).toString())
|
||||
ti->setFont(0, bf);
|
||||
}
|
||||
}
|
||||
@@ -496,7 +496,7 @@ void ProjectFilesystemWidget::on_actionOpen_external_triggered() {
|
||||
|
||||
void ProjectFilesystemWidget::on_actionShow_external_triggered() {
|
||||
if (projectfs_menu_target.path().isEmpty()) return;
|
||||
Core::FileUtils::showInGraphicalShell(Core::ICore::mainWindow(), Utils::FilePath::fromString(projectfs_menu_target.absoluteFilePath()));
|
||||
Core::FileUtils::showInGraphicalShell(Utils::FilePath::fromString(projectfs_menu_target.absoluteFilePath()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user