Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Friedrich W. H. Kossebau
kdevelop
Commits
0f53e240
Commit
0f53e240
authored
Dec 14, 2019
by
Juraj Oravec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMake: Show project name in showConfigureErrorMessage
Signed-off-by:
Juraj Oravec
<
sgd.orava@gmail.com
>
parent
1dda8e10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
plugins/cmake/cmakemanager.cpp
plugins/cmake/cmakemanager.cpp
+6
-5
plugins/cmake/cmakemanager.h
plugins/cmake/cmakemanager.h
+1
-1
No files found.
plugins/cmake/cmakemanager.cpp
View file @
0f53e240
...
...
@@ -206,7 +206,7 @@ KJob* CMakeManager::createImportJob(ProjectFolderItem* item)
if
(
job
->
error
()
!=
0
)
{
qCWarning
(
CMAKE
)
<<
"couldn't load project successfully"
<<
project
->
name
();
m_projects
.
remove
(
project
);
showConfigureErrorMessage
(
job
->
errorText
());
showConfigureErrorMessage
(
project
->
name
(),
job
->
errorText
());
}
});
...
...
@@ -399,7 +399,7 @@ void CMakeManager::serverResponse(KDevelop::IProject* project, const QJsonObject
}
else
qCDebug
(
CMAKE
)
<<
"unhandled signal response..."
<<
project
<<
response
;
}
else
if
(
response
[
QStringLiteral
(
"type"
)]
==
QLatin1String
(
"error"
))
{
showConfigureErrorMessage
(
response
[
QStringLiteral
(
"errorMessage"
)].
toString
());
showConfigureErrorMessage
(
project
->
name
(),
response
[
QStringLiteral
(
"errorMessage"
)].
toString
());
}
else
if
(
response
[
QStringLiteral
(
"type"
)]
==
QLatin1String
(
"reply"
))
{
const
auto
inReplyTo
=
response
[
QStringLiteral
(
"inReplyTo"
)];
if
(
inReplyTo
==
QLatin1String
(
"configure"
))
{
...
...
@@ -860,19 +860,20 @@ KTextEditor::Range CMakeManager::termRangeAtPosition(const KTextEditor::Document
return
KTextEditor
::
Range
(
start
,
end
);
}
void
CMakeManager
::
showConfigureErrorMessage
(
const
QString
&
errorMessage
)
const
void
CMakeManager
::
showConfigureErrorMessage
(
const
QString
&
projectName
,
const
QString
&
errorMessage
)
const
{
if
(
!
QApplication
::
activeWindow
())
{
// Do not show a message box if there is no active window in order not to block unit tests.
return
;
}
KMessageBox
::
error
(
QApplication
::
activeWindow
(),
i18n
(
"Failed to configure
the
project (error message: %
1
)."
"Failed to configure project
'%1'
(error message: %
2
)."
" As a result, KDevelop's code understanding will likely be broken.
\n
"
"
\n
"
"To fix this issue, please ensure that the project's CMakeLists.txt files"
" are correct, and KDevelop is configured to use the correct CMake version and settings."
" Then right-click the project item in the projects tool view and click 'Reload'."
,
errorMessage
));
" Then right-click the project item in the projects tool view and click 'Reload'."
,
projectName
,
errorMessage
));
}
QPair
<
QWidget
*
,
KTextEditor
::
Range
>
CMakeManager
::
specialLanguageObjectNavigationWidget
(
const
QUrl
&
url
,
const
KTextEditor
::
Cursor
&
position
)
...
...
plugins/cmake/cmakemanager.h
View file @
0f53e240
...
...
@@ -162,7 +162,7 @@ private:
KTextEditor
::
Range
termRangeAtPosition
(
const
KTextEditor
::
Document
*
textDocument
,
const
KTextEditor
::
Cursor
&
position
)
const
;
void
showConfigureErrorMessage
(
const
QString
&
errorMessage
)
const
;
void
showConfigureErrorMessage
(
const
QString
&
projectName
,
const
QString
&
errorMessage
)
const
;
private:
QHash
<
KDevelop
::
IProject
*
,
CMakeProjectData
>
m_projects
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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