Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
ad104792
Commit
ad104792
authored
Apr 17, 2009
by
dt
Browse files
Fix the directories the cmakelugin checks for the debugger plugin
I need to refactor that code for 1.2.
parent
dd67f085
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp
View file @
ad104792
...
...
@@ -155,7 +155,10 @@ QString CMakeManager::qtVersionForQMake(const QString &qmakePath)
return
QString
();
}
QString
CMakeManager
::
findQtDir
(
const
ProjectExplorer
::
Environment
&
env
)
// this is mostly a copy from qt4versionmanager
// TODO refactor this code
// returns QPair< QTDIR, QT_INSTALL_DATA >
QPair
<
QString
,
QString
>
CMakeManager
::
findQtDir
(
const
ProjectExplorer
::
Environment
&
env
)
{
QStringList
possibleCommands
;
// On windows noone has renamed qmake, right?
...
...
@@ -171,21 +174,23 @@ QString CMakeManager::findQtDir(const ProjectExplorer::Environment &env)
QFileInfo
qmake
(
path
+
"/"
+
possibleCommand
);
if
(
qmake
.
exists
())
{
if
(
!
qtVersionForQMake
(
qmake
.
absoluteFilePath
()).
isNull
())
{
QDir
qtDir
=
qmake
.
absoluteDir
();
qtDir
.
cdUp
();
QProcess
proc
;
proc
.
start
(
qmake
.
absoluteFilePath
(),
QStringList
()
<<
"-query"
<<
"QT_INSTALL_DATA"
);
if
(
proc
.
waitForFinished
())
{
return
proc
.
readAll
().
trimmed
();
return
qMakePair
(
qtDir
.
absolutePath
(),
QString
(
proc
.
readAll
().
trimmed
()
))
;
}
else
{
proc
.
kill
();
QDir
dir
(
qmake
.
absoluteDir
());
dir
.
cdUp
();
return
dir
.
absolutePath
();
return
qMakePair
(
qtDir
.
absolutePath
(),
dir
.
absolutePath
()
)
;
}
}
}
}
}
return
QString
(
);
return
qMakePair
(
QString
(),
QString
()
);
}
// This code is more or less duplicated in qtversionmanager
...
...
@@ -195,14 +200,16 @@ QString CMakeManager::findDumperLibrary(const ProjectExplorer::Environment &env)
static
QString
lastpath
;
if
(
lastenv
==
env
)
return
lastpath
;
QString
qtdir
=
findQtDir
(
env
);
if
(
qtdir
.
isEmpty
())
QPair
<
QString
,
QString
>
pair
=
findQtDir
(
env
);
QString
qtInstallDataDir
=
pair
.
second
;
if
(
qtInstallDataDir
.
isEmpty
())
return
QString
();
uint
hash
=
qHash
(
qtdir
);
uint
hash
=
qHash
(
pair
.
first
);
QStringList
directories
;
directories
<<
(
qt
d
ir
+
"/qtc-debugging-helper/"
)
<<
(
qt
InstallDataD
ir
+
"/qtc-debugging-helper/"
)
<<
(
QApplication
::
applicationDirPath
()
+
"/../qtc-debugging-helper/"
+
QString
::
number
(
hash
))
+
"/"
<<
(
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DataLocation
)
+
"/qtc-debugging-helper/"
+
QString
::
number
(
hash
))
+
"/"
;
foreach
(
const
QString
&
directory
,
directories
)
{
...
...
src/plugins/cmakeprojectmanager/cmakeprojectmanager.h
View file @
ad104792
...
...
@@ -65,7 +65,7 @@ public:
static
QString
findDumperLibrary
(
const
ProjectExplorer
::
Environment
&
env
);
private:
static
QString
qtVersionForQMake
(
const
QString
&
qmakePath
);
static
Q
String
findQtDir
(
const
ProjectExplorer
::
Environment
&
env
);
static
Q
Pair
<
QString
,
QString
>
findQtDir
(
const
ProjectExplorer
::
Environment
&
env
);
int
m_projectContext
;
int
m_projectLanguage
;
CMakeSettingsPage
*
m_settingsPage
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment