- fix: Use "/" as path seperator when starting app by double clicking c/c++ files in the explorer.

This commit is contained in:
Roy Qu 2023-06-16 17:57:24 +08:00
parent 5e78c0aa62
commit be8a5610a4
3 changed files with 13 additions and 4 deletions

View File

@ -5,6 +5,7 @@ Red Panda C++ Version 2.23
- enhancement: Tooltip support for '->' operator on std iterators.
- enhancement: Close other editors.
- fix: Goto definition/Goto declaration/Info tips can't be correctly triggered when mouse pointer is at the last half character of current word.
- fix: Use "/" as path seperator when starting app by double clicking c/c++ files in the explorer.
Red Panda C++ Version 2.22

View File

@ -1453,10 +1453,15 @@ void MainWindow::openFiles(const QStringList &files)
e->activate();
}
Editor* MainWindow::openFile(const QString &filename, bool activate, QTabWidget* page)
Editor* MainWindow::openFile(QString filename, bool activate, QTabWidget* page)
{
if (!fileExists(filename))
return nullptr;
QFileInfo info=QFileInfo(filename);
if (info.isAbsolute())
filename = info.absoluteFilePath();
Editor* editor = mEditorList->getOpenedEditorByFilename(filename);
if (editor!=nullptr) {
if (activate) {
@ -1501,11 +1506,14 @@ Editor* MainWindow::openFile(const QString &filename, bool activate, QTabWidget*
return nullptr;
}
void MainWindow::openProject(const QString &filename, bool openFiles)
void MainWindow::openProject(QString filename, bool openFiles)
{
if (!fileExists(filename)) {
return;
}
QFileInfo info=QFileInfo(filename);
if (info.isAbsolute())
filename = info.absoluteFilePath();
Editor* oldEditor=nullptr;
if (mProject) {
if (mProject->filename() == filename)

View File

@ -221,8 +221,8 @@ public:
TodoModel* todoModel();
Editor* openFile(const QString& filename, bool activate=true, QTabWidget* page=nullptr);
void openProject(const QString& filename, bool openFiles = true);
Editor* openFile(QString filename, bool activate=true, QTabWidget* page=nullptr);
void openProject(QString filename, bool openFiles = true);
void changeOptions(const QString& widgetName=QString(), const QString& groupName=QString());
void changeProjectOptions(const QString& widgetName=QString(), const QString& groupName=QString());