Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 10afcc9045 | |||
| ea1547bb70 | |||
| 62ec870192 | |||
| 8ef5bef4b7 | |||
| 6c7ecded4d | |||
| f89b9dee7b | |||
| ed8e9f4e05 | |||
| eb04500c28 | |||
| 8c4ba2b049 | |||
| f3e8a364d2 | |||
| e4ca4018ca | |||
| 57d5b83daf |
18
build_files/CMakeLists.txt.patch
Normal file
18
build_files/CMakeLists.txt.patch
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
--- CMakeLists.txt 2022-04-13 11:22:25.245680300 +0300
|
||||||
|
+++ CMakeLists_f.txt 2023-03-15 14:11:55.883681000 +0300
|
||||||
|
@@ -7,6 +7,7 @@
|
||||||
|
|
||||||
|
include(FeatureSummary)
|
||||||
|
include(QtCreatorIDEBranding RESULT_VARIABLE IDE_BRANDING_FILE)
|
||||||
|
+project(QtCreator VERSION ${IDE_VERSION})
|
||||||
|
include(QtCreatorTranslations)
|
||||||
|
include(QtCreatorDocumentation)
|
||||||
|
include(QtCreatorAPI)
|
||||||
|
@@ -17,7 +18,6 @@
|
||||||
|
|
||||||
|
mark_as_advanced(IDE_REVISION IDE_REVISION_STR IDE_REVISION_URL)
|
||||||
|
|
||||||
|
-project(QtCreator VERSION ${IDE_VERSION})
|
||||||
|
|
||||||
|
# Force C++ standard, do not fall back, do not use compiler extensions
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
14
build_files/clangformatbaseindenter.patch
Normal file
14
build_files/clangformatbaseindenter.patch
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
--- /soft/qt-creator/src/plugins/clangformat/clangformatbaseindenter.cpp 2022-12-07 04:26:12.928000000 +0000
|
||||||
|
+++ /soft/clangformatbaseindenter.cpp 2022-12-07 04:20:13.644000000 +0000
|
||||||
|
@@ -61,7 +61,11 @@
|
||||||
|
|
||||||
|
// This is a separate pass, don't do it unless it's the full formatting.
|
||||||
|
style.FixNamespaceComments = false;
|
||||||
|
+#if LLVM_VERSION_MAJOR >= 16
|
||||||
|
+ style.AlignTrailingComments.Kind = clang::format::FormatStyle::TCAS_Never;
|
||||||
|
+#else
|
||||||
|
style.AlignTrailingComments = false;
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
if (replacementsToKeep == ReplacementsToKeep::IndentAndBefore)
|
||||||
|
return;
|
||||||
14
build_files/clangformatutils.patch
Normal file
14
build_files/clangformatutils.patch
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
--- /soft/qt-creator/src/plugins/clangformat/clangformatutils.cpp 2022-12-07 04:26:12.928000000 +0000
|
||||||
|
+++ /soft/clangformatutils.cpp 2022-12-07 04:20:31.924000000 +0000
|
||||||
|
@@ -71,7 +71,11 @@
|
||||||
|
#else
|
||||||
|
style.AlignOperands = true;
|
||||||
|
#endif
|
||||||
|
+#if LLVM_VERSION_MAJOR >= 16
|
||||||
|
+ style.AlignTrailingComments.Kind = clang::format::FormatStyle::TCAS_Always;
|
||||||
|
+#else
|
||||||
|
style.AlignTrailingComments = true;
|
||||||
|
+#endif
|
||||||
|
style.AllowAllParametersOfDeclarationOnNextLine = true;
|
||||||
|
#if LLVM_VERSION_MAJOR >= 10
|
||||||
|
style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Never;
|
||||||
12
build_files/qlitehtml_CMakeLists.patch
Normal file
12
build_files/qlitehtml_CMakeLists.patch
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
--- /soft/qt-creator/src/libs/qlitehtml/src/CMakeLists.txt 2022-12-07 11:51:30.324000000 +0000
|
||||||
|
+++ ./CMakeLists.txt 2022-12-07 11:50:56.132000000 +0000
|
||||||
|
@@ -12,8 +12,7 @@
|
||||||
|
set(QLITEHTML_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
|
||||||
|
set(QLITEHTML_VERSION_COMPAT ${QLITEHTML_VERSION} CACHE STRING "qlitehtml compat version number.")
|
||||||
|
|
||||||
|
-find_package(litehtml QUIET)
|
||||||
|
-if(NOT TARGET litehtml AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/litehtml/CMakeLists.txt)
|
||||||
|
+if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/litehtml/CMakeLists.txt)
|
||||||
|
set(ORIG_FPIC ${CMAKE_POSITION_INDEPENDENT_CODE})
|
||||||
|
set(ORIG_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
|
||||||
|
if (WIN32)
|
||||||
8
build_files/remove_elf.sh
Normal file
8
build_files/remove_elf.sh
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
for f in $(ls ./)
|
||||||
|
do
|
||||||
|
if [[ $(file -b $f | grep "ELF 64-bit") ]]
|
||||||
|
then
|
||||||
|
rm -v $f
|
||||||
|
fi
|
||||||
|
done
|
||||||
22
build_files/toolchain-Windows.cmake
Normal file
22
build_files/toolchain-Windows.cmake
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
set(CMAKE_SYSTEM_NAME Windows)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc-posix )
|
||||||
|
set(CMAKE_C_COMPILER_AR /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc-ar-posix )
|
||||||
|
set(CMAKE_C_COMPILER_RANLIB /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc-ranlib-posix )
|
||||||
|
set(CMAKE_CXX_COMPILER /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-g++-posix )
|
||||||
|
set(CMAKE_CXX_COMPILER_AR /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc-ar-posix )
|
||||||
|
set(CMAKE_CXX_COMPILER_RANLIB /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc-ranlib-posix )
|
||||||
|
set(CMAKE_ASM_NASM_COMPILER /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-as )
|
||||||
|
set(CMAKE_RC_COMPILER /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-windres)
|
||||||
|
set(CMAKE_OBJDUMP /usr/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-objdump)
|
||||||
|
add_definitions(-D_WIN32_WINNT=0x600 -D_GNU_SOURCE=1 -DNOWERROR=1 -DPROCESSOR_ARCHITECTURE_ARM64=12 -DUNICODE)
|
||||||
|
|
||||||
|
set(CMAKE_PREFIX_PATH /soft/windows)
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH /usr/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32 ${CMAKE_PREFIX_PATH}/lib)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY FIRST)
|
||||||
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE FIRST)
|
||||||
|
include_directories(${CMAKE_PREFIX_PATH}/include)
|
||||||
|
set(OpenCL_INCLUDE_DIR ${CMAKE_PREFIX_PATH}/include)
|
||||||
|
set(OpenCL_LIBRARY ${CMAKE_PREFIX_PATH}/lib/opencl.lib)
|
||||||
@@ -1,7 +1,13 @@
|
|||||||
#cmake_minimum_required(VERSION 3.17)
|
cmake_minimum_required(VERSION 3.17)
|
||||||
#project(ProjectFilesystemPlugin)
|
project(ProjectFilesystemPlugin)
|
||||||
#include($ENV{SDK_QTCREATOR_SRC}/cmake/QtCreatorAPI.cmake)
|
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")
|
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc")
|
||||||
add_qtc_plugin(ProjectFilesystemPlugin
|
add_qtc_plugin(ProjectFilesystemPlugin
|
||||||
PLUGIN_DEPENDS Core ProjectExplorer
|
PLUGIN_DEPENDS
|
||||||
|
QtCreator::Core
|
||||||
|
QtCreator::ProjectExplorer
|
||||||
SOURCES ${SRC})
|
SOURCES ${SRC})
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
{
|
{
|
||||||
\"Name\" : \"ProjectFilesystemPlugin\",
|
"Id": "projectfilesystemplugin",
|
||||||
\"Version\" : \"2.0.0\",
|
"Name" : "ProjectFilesystemPlugin",
|
||||||
\"CompatVersion\" : \"1.1.0\",
|
"Version" : "3.0.0",
|
||||||
\"Vendor\" : \"Peri4\",
|
"CompatVersion" : "${IDE_VERSION_COMPAT}",
|
||||||
\"Copyright\" : \"(C) Peri4\",
|
"VendorId" : "peri4",
|
||||||
\"License\" : \"LGPLv3\",
|
"Vendor" : "Peri4",
|
||||||
\"Description\" : \"LGPLv3\",
|
"Copyright" : "(C) Peri4",
|
||||||
\"Url\" : \"\",
|
"License" : "LGPLv3",
|
||||||
$$dependencyList
|
"Description" : "LGPLv3",
|
||||||
|
"Url" : "",
|
||||||
|
${DESIGNER_PLUGIN_ARGUMENTS}
|
||||||
|
${IDE_PLUGIN_DEPENDENCIES}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public:
|
|||||||
void setFilter(const Filter & f);
|
void setFilter(const Filter & f);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void changeEvent(QEvent *e);
|
void changeEvent(QEvent *e) override;
|
||||||
|
|
||||||
QStringList getFilters(QLineEdit * le) const;
|
QStringList getFilters(QLineEdit * le) const;
|
||||||
void setFilters(QLineEdit * le, QStringList f);
|
void setFilters(QLineEdit * le, QStringList f);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ namespace ProjectFilesystemPlugin {
|
|||||||
{
|
{
|
||||||
Utils::globalMacroExpander()->registerPrefix("ProjectFilesystem", "Project filesystem plugin", [](QString v) -> QString {return v;} );
|
Utils::globalMacroExpander()->registerPrefix("ProjectFilesystem", "Project filesystem plugin", [](QString v) -> QString {return v;} );
|
||||||
Utils::globalMacroExpander()->registerFileVariables("ProjectFilesystem", "Selected item",
|
Utils::globalMacroExpander()->registerFileVariables("ProjectFilesystem", "Selected item",
|
||||||
[]() -> QString { return projectfs_menu_target.absoluteFilePath();});
|
[]() -> Utils::FilePath { return Utils::FilePath::fromString(projectfs_menu_target.absoluteFilePath());}, true);
|
||||||
// Retrieve objects from the plugin manager's object pool
|
// Retrieve objects from the plugin manager's object pool
|
||||||
// In the extensionsInitialized function, a plugin can be sure that all
|
// In the extensionsInitialized function, a plugin can be sure that all
|
||||||
// plugins that depend on it are completely initialized.
|
// plugins that depend on it are completely initialized.
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ namespace ProjectFilesystemPlugin {
|
|||||||
ProjectFilesystemPluginPlugin();
|
ProjectFilesystemPluginPlugin();
|
||||||
~ProjectFilesystemPluginPlugin();
|
~ProjectFilesystemPluginPlugin();
|
||||||
|
|
||||||
bool initialize(const QStringList &arguments, QString *errorString);
|
bool initialize(const QStringList &arguments, QString *errorString) override;
|
||||||
void extensionsInitialized();
|
void extensionsInitialized() override;
|
||||||
ShutdownFlag aboutToShutdown();
|
ShutdownFlag aboutToShutdown() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void triggerAction();
|
void triggerAction();
|
||||||
|
|||||||
@@ -4,22 +4,23 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/fileutils.h>
|
#include <coreplugin/fileutils.h>
|
||||||
#include <coreplugin/navigationwidget.h>
|
#include <coreplugin/navigationwidget.h>
|
||||||
#include <coreplugin/fileiconprovider.h>
|
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorericons.h>
|
#include <projectexplorer/projectexplorericons.h>
|
||||||
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/projecttreewidget.h>
|
#include <projectexplorer/projecttreewidget.h>
|
||||||
#include <projectexplorer/projecttree.h>
|
#include <projectexplorer/projecttree.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectnodes.h>
|
#include <projectexplorer/projectnodes.h>
|
||||||
#include <projectexplorer/buildmanager.h>
|
#include <projectexplorer/buildmanager.h>
|
||||||
#include <projectexplorer/session.h>
|
#include <projectexplorer/projectmanager.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
#include <utils/macroexpander.h>
|
#include <utils/macroexpander.h>
|
||||||
|
#include <utils/fsengine/fileiconprovider.h>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@@ -39,6 +40,15 @@ const int roleFullPath = Qt::UserRole;
|
|||||||
const int roleItemType = Qt::UserRole + 1;
|
const int roleItemType = Qt::UserRole + 1;
|
||||||
const int roleIsDir = Qt::UserRole + 2;
|
const int roleIsDir = Qt::UserRole + 2;
|
||||||
const int roleProject = Qt::UserRole + 3;
|
const int roleProject = Qt::UserRole + 3;
|
||||||
|
const int roleLabel = Qt::UserRole + 4;
|
||||||
|
|
||||||
|
|
||||||
|
void setItemProjectName(ProjectExplorer::Project * pr, QTreeWidgetItem * item) {
|
||||||
|
if (!pr || !item) return;
|
||||||
|
QString dn = pr->displayName(), l = item->data(0, roleLabel).toString();
|
||||||
|
if (!l.isEmpty()) dn += " (" + l + ")";
|
||||||
|
item->setText(0, dn);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QAction * newSeparator() {
|
QAction * newSeparator() {
|
||||||
@@ -47,6 +57,7 @@ QAction * newSeparator() {
|
|||||||
return sep;
|
return sep;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ProjectFilesystemWidget::ProjectFilesystemWidget(QWidget * parent): QWidget(parent) {
|
ProjectFilesystemWidget::ProjectFilesystemWidget(QWidget * parent): QWidget(parent) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
item_target = nullptr;
|
item_target = nullptr;
|
||||||
@@ -58,7 +69,7 @@ ProjectFilesystemWidget::ProjectFilesystemWidget(QWidget * parent): QWidget(pare
|
|||||||
buttonCollapse->setIcon(Utils::Icons::COLLAPSE.icon());
|
buttonCollapse->setIcon(Utils::Icons::COLLAPSE.icon());
|
||||||
actionOpen_here->setIcon(Utils::Icons::OPENFILE.icon());
|
actionOpen_here->setIcon(Utils::Icons::OPENFILE.icon());
|
||||||
actionOpen_external->setIcon(Utils::Icons::OPENFILE.icon());
|
actionOpen_external->setIcon(Utils::Icons::OPENFILE.icon());
|
||||||
actionShow_external->setIcon(Core::FileIconProvider::icon(QFileIconProvider::Folder));
|
actionShow_external->setIcon(Utils::FileIconProvider::icon(QFileIconProvider::Folder));
|
||||||
actionCopy_name->setIcon(Utils::Icons::COPY.icon());
|
actionCopy_name->setIcon(Utils::Icons::COPY.icon());
|
||||||
actionCopy_path->setIcon(Utils::Icons::COPY.icon());
|
actionCopy_path->setIcon(Utils::Icons::COPY.icon());
|
||||||
actionBuild->setIcon(ProjectExplorer::Icons::BUILD_SMALL.icon());
|
actionBuild->setIcon(ProjectExplorer::Icons::BUILD_SMALL.icon());
|
||||||
@@ -76,23 +87,23 @@ ProjectFilesystemWidget::ProjectFilesystemWidget(QWidget * parent): QWidget(pare
|
|||||||
this_actions << actionCopy_name << actionCopy_path;
|
this_actions << actionCopy_name << actionCopy_path;
|
||||||
proj_plug = 0;
|
proj_plug = 0;
|
||||||
//connect(ProjectExplorer::ProjectTree::instance(), SIGNAL(subtreeChanged(ProjectExplorer::FolderNode*)), this, SLOT(projectsChanged()));
|
//connect(ProjectExplorer::ProjectTree::instance(), SIGNAL(subtreeChanged(ProjectExplorer::FolderNode*)), this, SLOT(projectsChanged()));
|
||||||
connect(ProjectExplorer::SessionManager::instance(), SIGNAL(startupProjectChanged(ProjectExplorer::Project *)), this, SLOT(startupProjectChanged()));
|
connect(ProjectExplorer::ProjectManager::instance(), SIGNAL(startupProjectChanged(ProjectExplorer::Project *)), this, SLOT(startupProjectChanged()));
|
||||||
connect(ProjectExplorer::SessionManager::instance(), &ProjectExplorer::SessionManager::projectAdded, [this](ProjectExplorer::Project * p){
|
connect(ProjectExplorer::ProjectManager::instance(), &ProjectExplorer::ProjectManager::projectAdded, [this](ProjectExplorer::Project * p){
|
||||||
createProjectTree(p);
|
createProjectTree(p);
|
||||||
filter();
|
filter();
|
||||||
startupProjectChanged();
|
startupProjectChanged();
|
||||||
});
|
});
|
||||||
connect(ProjectExplorer::SessionManager::instance(), &ProjectExplorer::SessionManager::projectDisplayNameChanged, [this](ProjectExplorer::Project * p){
|
connect(ProjectExplorer::ProjectManager::instance(), &ProjectExplorer::ProjectManager::projectDisplayNameChanged, [this](ProjectExplorer::Project * p){
|
||||||
projectNameChanged();
|
projectNameChanged();
|
||||||
});
|
});
|
||||||
connect(ProjectExplorer::SessionManager::instance(), &ProjectExplorer::SessionManager::projectRemoved, [this](ProjectExplorer::Project * p){
|
connect(ProjectExplorer::ProjectManager::instance(), &ProjectExplorer::ProjectManager::projectRemoved, [this](ProjectExplorer::Project * p){
|
||||||
QTreeWidgetItem * pi = projectItem(p);
|
QTreeWidgetItem * pi = projectItem(p);
|
||||||
if (!pi) return;
|
if (!pi) return;
|
||||||
delete pi;
|
delete pi;
|
||||||
cleanMappedItems();
|
cleanMappedItems();
|
||||||
startupProjectChanged();
|
startupProjectChanged();
|
||||||
});
|
});
|
||||||
//connect(ProjectExplorer::SessionManager::instance(), SIGNAL(), this, SLOT(startupProjectChanged()));
|
//connect(ProjectExplorer::ProjectManager::instance(), SIGNAL(), this, SLOT(startupProjectChanged()));
|
||||||
connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), this, SLOT(currentFileChanged()));
|
connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), this, SLOT(currentFileChanged()));
|
||||||
connect(&fs_watcher, SIGNAL(directoryChanged(const QString &)), this, SLOT(directoryChanged(const QString &)));
|
connect(&fs_watcher, SIGNAL(directoryChanged(const QString &)), this, SLOT(directoryChanged(const QString &)));
|
||||||
projectsChanged();
|
projectsChanged();
|
||||||
@@ -145,7 +156,7 @@ void ProjectFilesystemWidget::projectNameChanged() {
|
|||||||
for (int i = 0; i < tree->topLevelItemCount(); ++i) {
|
for (int i = 0; i < tree->topLevelItemCount(); ++i) {
|
||||||
ProjectExplorer::Project * p = (ProjectExplorer::Project *)itemProject(tree->topLevelItem(i));
|
ProjectExplorer::Project * p = (ProjectExplorer::Project *)itemProject(tree->topLevelItem(i));
|
||||||
if (!p) continue;
|
if (!p) continue;
|
||||||
tree->topLevelItem(i)->setText(0, p->displayName());
|
setItemProjectName(p, tree->topLevelItem(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +180,7 @@ void ProjectFilesystemWidget::createTree(QTreeWidgetItem * ti, const QString & d
|
|||||||
}
|
}
|
||||||
QTreeWidgetItem * ni = new QTreeWidgetItem();
|
QTreeWidgetItem * ni = new QTreeWidgetItem();
|
||||||
ni->setText(0, nit);
|
ni->setText(0, nit);
|
||||||
ni->setIcon(0, Core::FileIconProvider::icon(i));
|
ni->setIcon(0, Utils::FileIconProvider::icon(Utils::FilePath::fromString(i.absoluteFilePath())));
|
||||||
ni->setData(0, roleFullPath, i.absoluteFilePath());
|
ni->setData(0, roleFullPath, i.absoluteFilePath());
|
||||||
ni->setData(0, roleItemType, i.isDir() ? itDir : itFile);
|
ni->setData(0, roleItemType, i.isDir() ? itDir : itFile);
|
||||||
ni->setData(0, roleIsDir, i.isDir());
|
ni->setData(0, roleIsDir, i.isDir());
|
||||||
@@ -275,7 +286,7 @@ void ProjectFilesystemWidget::projectsChanged() {
|
|||||||
tree->clear();
|
tree->clear();
|
||||||
fs_watcher.removePaths(fs_watcher.directories());
|
fs_watcher.removePaths(fs_watcher.directories());
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
QList<ProjectExplorer::Project *> pl = ProjectExplorer::SessionManager::projects();
|
QList<ProjectExplorer::Project *> pl = ProjectExplorer::ProjectManager::projects();
|
||||||
for (ProjectExplorer::Project * p: pl) {
|
for (ProjectExplorer::Project * p: pl) {
|
||||||
createProjectTree(p);
|
createProjectTree(p);
|
||||||
}
|
}
|
||||||
@@ -299,16 +310,22 @@ void ProjectFilesystemWidget::createProjectTree(void * p) {
|
|||||||
ProjectExplorer::Project * pr = (ProjectExplorer::Project *)p;
|
ProjectExplorer::Project * pr = (ProjectExplorer::Project *)p;
|
||||||
QTreeWidgetItem * ri = new QTreeWidgetItem();
|
QTreeWidgetItem * ri = new QTreeWidgetItem();
|
||||||
QString dir = pr->projectDirectory().toString();
|
QString dir = pr->projectDirectory().toString();
|
||||||
ri->setText(0, pr->displayName());
|
|
||||||
QFile logo(dir + "/logo.png");
|
QFile logo(dir + "/logo.png");
|
||||||
if (logo.exists())
|
if (logo.exists())
|
||||||
ri->setIcon(0, QIcon(logo.fileName()));
|
ri->setIcon(0, QIcon(logo.fileName()));
|
||||||
else
|
else
|
||||||
ri->setIcon(0, Core::FileIconProvider::icon(QFileIconProvider::Folder));
|
ri->setIcon(0, Utils::FileIconProvider::icon(QFileIconProvider::Folder));
|
||||||
|
QFile label(dir + "/label.txt");
|
||||||
|
if (label.exists()) {
|
||||||
|
label.open(QIODevice::ReadOnly);
|
||||||
|
ri->setData(0, roleLabel, QString::fromUtf8(label.readAll()).trimmed());
|
||||||
|
} else
|
||||||
|
ri->setData(0, roleLabel, QString());
|
||||||
ri->setData(0, roleProject, (qulonglong)pr);
|
ri->setData(0, roleProject, (qulonglong)pr);
|
||||||
ri->setData(0, roleFullPath, dir);
|
ri->setData(0, roleFullPath, dir);
|
||||||
ri->setData(0, roleIsDir, true);
|
ri->setData(0, roleIsDir, true);
|
||||||
ri->setData(0, roleItemType, itProject);
|
ri->setData(0, roleItemType, itProject);
|
||||||
|
setItemProjectName(pr, ri);
|
||||||
createTree(ri, dir);
|
createTree(ri, dir);
|
||||||
tree->addTopLevelItem(ri);
|
tree->addTopLevelItem(ri);
|
||||||
}
|
}
|
||||||
@@ -333,7 +350,7 @@ void ProjectFilesystemWidget::currentFileChanged() {
|
|||||||
|
|
||||||
|
|
||||||
void ProjectFilesystemWidget::startupProjectChanged() {
|
void ProjectFilesystemWidget::startupProjectChanged() {
|
||||||
ProjectExplorer::Project * sp = ProjectExplorer::SessionManager::startupProject();
|
ProjectExplorer::Project * sp = ProjectExplorer::ProjectManager::startupProject();
|
||||||
QFont f(tree->font()), bf(f);
|
QFont f(tree->font()), bf(f);
|
||||||
bf.setBold(true);
|
bf.setBold(true);
|
||||||
for (int i = 0; i < tree->topLevelItemCount(); ++i) {
|
for (int i = 0; i < tree->topLevelItemCount(); ++i) {
|
||||||
@@ -389,7 +406,7 @@ void ProjectFilesystemWidget::on_tree_itemDoubleClicked(QTreeWidgetItem * item,
|
|||||||
bool dir = item->data(0, roleIsDir).toBool();
|
bool dir = item->data(0, roleIsDir).toBool();
|
||||||
if (dir) return;
|
if (dir) return;
|
||||||
if (afp.isEmpty()) return;
|
if (afp.isEmpty()) return;
|
||||||
Core::EditorManager::openEditor(afp);
|
Core::EditorManager::openEditor(Utils::FilePath::fromString(afp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -427,7 +444,7 @@ void ProjectFilesystemWidget::on_tree_customContextMenuRequested(const QPoint &
|
|||||||
|
|
||||||
/*if (item->data(0, roleItemType).toInt() == itProject) {
|
/*if (item->data(0, roleItemType).toInt() == itProject) {
|
||||||
QString proj_path = item->data(0, roleFullPath).toString();
|
QString proj_path = item->data(0, roleFullPath).toString();
|
||||||
ProjectExplorer::Project * project = Utils::findOrDefault(ProjectExplorer::SessionManager::projects(),
|
ProjectExplorer::Project * project = Utils::findOrDefault(ProjectExplorer::ProjectManager::projects(),
|
||||||
[proj_path](const ProjectExplorer::Project * p) {return p->containerNode()->path() == proj_path;});
|
[proj_path](const ProjectExplorer::Project * p) {return p->containerNode()->path() == proj_path;});
|
||||||
//ProjectExplorer::ProjectTree::instance()->setCurrent
|
//ProjectExplorer::ProjectTree::instance()->setCurrent
|
||||||
|
|
||||||
@@ -438,7 +455,7 @@ void ProjectFilesystemWidget::on_tree_customContextMenuRequested(const QPoint &
|
|||||||
}*/
|
}*/
|
||||||
ProjectExplorer::Project * p = (ProjectExplorer::Project *)itemProject(item_target);
|
ProjectExplorer::Project * p = (ProjectExplorer::Project *)itemProject(item_target);
|
||||||
if (p) {
|
if (p) {
|
||||||
actionSet_as_startup->setVisible(p != ProjectExplorer::SessionManager::startupProject());
|
actionSet_as_startup->setVisible(p != ProjectExplorer::ProjectManager::startupProject());
|
||||||
bool can_build = !p->needsConfiguration(), can_run = false;
|
bool can_build = !p->needsConfiguration(), can_run = false;
|
||||||
if (p->activeTarget()) {
|
if (p->activeTarget()) {
|
||||||
can_build = can_build && p->activeTarget()->activeBuildConfiguration();
|
can_build = can_build && p->activeTarget()->activeBuildConfiguration();
|
||||||
@@ -464,7 +481,7 @@ void ProjectFilesystemWidget::on_tree_customContextMenuRequested(const QPoint &
|
|||||||
|
|
||||||
void ProjectFilesystemWidget::on_actionOpen_here_triggered() {
|
void ProjectFilesystemWidget::on_actionOpen_here_triggered() {
|
||||||
if (projectfs_menu_target.path().isEmpty()) return;
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -479,13 +496,13 @@ void ProjectFilesystemWidget::on_actionOpen_external_triggered() {
|
|||||||
|
|
||||||
void ProjectFilesystemWidget::on_actionShow_external_triggered() {
|
void ProjectFilesystemWidget::on_actionShow_external_triggered() {
|
||||||
if (projectfs_menu_target.path().isEmpty()) return;
|
if (projectfs_menu_target.path().isEmpty()) return;
|
||||||
Core::FileUtils::showInGraphicalShell(Core::ICore::mainWindow(), projectfs_menu_target.absoluteFilePath());
|
Core::FileUtils::showInGraphicalShell(Core::ICore::mainWindow(), Utils::FilePath::fromString(projectfs_menu_target.absoluteFilePath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ProjectFilesystemWidget::on_actionOpen_terminal_triggered() {
|
void ProjectFilesystemWidget::on_actionOpen_terminal_triggered() {
|
||||||
if (projectfs_menu_target.path().isEmpty()) return;
|
if (projectfs_menu_target.path().isEmpty()) return;
|
||||||
Core::FileUtils::openTerminal(QDir(projectfs_menu_target.absoluteFilePath()).path());
|
Core::FileUtils::openTerminal(Utils::FilePath::fromString(QDir(projectfs_menu_target.absoluteFilePath()).path()), {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -504,7 +521,7 @@ void ProjectFilesystemWidget::on_actionCopy_path_triggered() {
|
|||||||
void ProjectFilesystemWidget::on_actionSet_as_startup_triggered() {
|
void ProjectFilesystemWidget::on_actionSet_as_startup_triggered() {
|
||||||
ProjectExplorer::Project * p = (ProjectExplorer::Project *)itemProject(item_target);
|
ProjectExplorer::Project * p = (ProjectExplorer::Project *)itemProject(item_target);
|
||||||
if (!p) return;
|
if (!p) return;
|
||||||
ProjectExplorer::SessionManager::setStartupProject(p);
|
ProjectExplorer::ProjectManager::setStartupProject(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -541,5 +558,5 @@ void ProjectFilesystemWidget::on_actionClose_project_triggered() {
|
|||||||
if (!p) return;
|
if (!p) return;
|
||||||
if (QMessageBox::question(0, "Project close", tr("Are you sure to close project \"%1\"?").arg(p->displayName())) != QMessageBox::Yes)
|
if (QMessageBox::question(0, "Project close", tr("Are you sure to close project \"%1\"?").arg(p->displayName())) != QMessageBox::Yes)
|
||||||
return;
|
return;
|
||||||
ProjectExplorer::SessionManager::removeProject(p);
|
ProjectExplorer::ProjectManager::removeProject(p);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,9 @@ public:
|
|||||||
void setCurrentSearch(QString v) {lineFilter->setText(v);}
|
void setCurrentSearch(QString v) {lineFilter->setText(v);}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void changeEvent(QEvent * e);
|
void changeEvent(QEvent * e) override;
|
||||||
void timerEvent(QTimerEvent * e);
|
void timerEvent(QTimerEvent * e) override;
|
||||||
|
|
||||||
void createTree(QTreeWidgetItem * ti, const QString & dir, bool proc_events = true);
|
void createTree(QTreeWidgetItem * ti, const QString & dir, bool proc_events = true);
|
||||||
void createProjectTree(void * p);
|
void createProjectTree(void * p);
|
||||||
void projectNameChanged();
|
void projectNameChanged();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "projectfilesystemwidgetplugin.h"
|
#include "projectfilesystemwidgetplugin.h"
|
||||||
#include "projectfilesystemwidget.h"
|
#include "projectfilesystemwidget.h"
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
#include <utils/qtcsettings.h>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@@ -29,7 +30,7 @@ Core::NavigationView ProjectFSWidgetFactory::createWidget() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ProjectFSWidgetFactory::saveSettings(QSettings * settings, int position, QWidget * widget) {
|
void ProjectFSWidgetFactory::saveSettings(Utils::QtcSettings * settings, int position, QWidget * widget) {
|
||||||
//QMessageBox::information(0, "", QString::fromLatin1(widget->metaObject()->className()));
|
//QMessageBox::information(0, "", QString::fromLatin1(widget->metaObject()->className()));
|
||||||
ProjectFilesystemWidget * w = qobject_cast<ProjectFilesystemWidget * >(widget);
|
ProjectFilesystemWidget * w = qobject_cast<ProjectFilesystemWidget * >(widget);
|
||||||
if (!w) return;
|
if (!w) return;
|
||||||
@@ -44,7 +45,7 @@ void ProjectFSWidgetFactory::saveSettings(QSettings * settings, int position, QW
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ProjectFSWidgetFactory::restoreSettings(QSettings * settings, int position, QWidget * widget) {
|
void ProjectFSWidgetFactory::restoreSettings(Utils::QtcSettings * settings, int position, QWidget * widget) {
|
||||||
ProjectFilesystemWidget * w = qobject_cast<ProjectFilesystemWidget * >(widget);
|
ProjectFilesystemWidget * w = qobject_cast<ProjectFilesystemWidget * >(widget);
|
||||||
if (!w) return;
|
if (!w) return;
|
||||||
settings->beginGroup("ProjectFilesystem");
|
settings->beginGroup("ProjectFilesystem");
|
||||||
@@ -56,7 +57,7 @@ void ProjectFSWidgetFactory::restoreSettings(QSettings * settings, int position,
|
|||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void ProjectFSWidgetFactory::changeEvent(QEvent *e) {
|
void ProjectFSWidgetFactory::changeEvent(QEvent *e) {
|
||||||
switch (e->type()) {
|
switch (e->type()) {
|
||||||
case QEvent::LanguageChange:
|
case QEvent::LanguageChange:
|
||||||
@@ -67,3 +68,4 @@ void ProjectFSWidgetFactory::changeEvent(QEvent *e) {
|
|||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|||||||
@@ -6,17 +6,16 @@
|
|||||||
|
|
||||||
class ProjectFSWidgetFactory: public Core::INavigationWidgetFactory
|
class ProjectFSWidgetFactory: public Core::INavigationWidgetFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
|
||||||
public:
|
public:
|
||||||
ProjectFSWidgetFactory();
|
ProjectFSWidgetFactory();
|
||||||
~ProjectFSWidgetFactory() {}
|
~ProjectFSWidgetFactory() {}
|
||||||
|
|
||||||
Core::NavigationView createWidget();
|
Core::NavigationView createWidget() override;
|
||||||
|
|
||||||
void saveSettings(QSettings * settings, int position, QWidget * widget);
|
void saveSettings(Utils::QtcSettings * settings, int position, QWidget * widget) override;
|
||||||
void restoreSettings(QSettings * settings, int position, QWidget * widget);
|
void restoreSettings(Utils::QtcSettings * settings, int position, QWidget * widget) override;
|
||||||
|
|
||||||
void changeEvent(QEvent * e);
|
//void changeEvent(QEvent * e) override;
|
||||||
|
|
||||||
QToolButton * btn_reload = nullptr, * btn_filters = nullptr;
|
QToolButton * btn_reload = nullptr, * btn_filters = nullptr;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user