adopt for QtCreator 8, separate build
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
#cmake_minimum_required(VERSION 3.17)
|
||||
#project(ProjectFilesystemPlugin)
|
||||
#include($ENV{SDK_QTCREATOR_SRC}/cmake/QtCreatorAPI.cmake)
|
||||
cmake_minimum_required(VERSION 3.17)
|
||||
project(ProjectFilesystemPlugin)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
find_package(QtCreator COMPONENTS Core REQUIRED)
|
||||
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc")
|
||||
add_qtc_plugin(ProjectFilesystemPlugin
|
||||
PLUGIN_DEPENDS Core ProjectExplorer
|
||||
SOURCES ${SRC})
|
||||
PLUGIN_DEPENDS
|
||||
QtCreator::Core
|
||||
QtCreator::ProjectExplorer
|
||||
SOURCES ${SRC})
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectexplorericons.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/projecttreewidget.h>
|
||||
#include <projectexplorer/projecttree.h>
|
||||
#include <projectexplorer/project.h>
|
||||
@@ -389,7 +390,7 @@ void ProjectFilesystemWidget::on_tree_itemDoubleClicked(QTreeWidgetItem * item,
|
||||
bool dir = item->data(0, roleIsDir).toBool();
|
||||
if (dir) return;
|
||||
if (afp.isEmpty()) return;
|
||||
Core::EditorManager::openEditor(afp);
|
||||
Core::EditorManager::openEditor(Utils::FilePath::fromString(afp));
|
||||
}
|
||||
|
||||
|
||||
@@ -464,7 +465,7 @@ void ProjectFilesystemWidget::on_tree_customContextMenuRequested(const QPoint &
|
||||
|
||||
void ProjectFilesystemWidget::on_actionOpen_here_triggered() {
|
||||
if (projectfs_menu_target.path().isEmpty()) return;
|
||||
Core::EditorManager::openEditor(projectfs_menu_target.absoluteFilePath(), Core::Constants::K_DEFAULT_TEXT_EDITOR_ID);
|
||||
Core::EditorManager::openEditor(Utils::FilePath::fromString(projectfs_menu_target.absoluteFilePath()), Core::Constants::K_DEFAULT_TEXT_EDITOR_ID);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user