Commit 03270ad3 authored by Nikolai Kosjar's avatar Nikolai Kosjar
Browse files

CppEditor: Prioritize inserting function def. in source file



For the quick fix InsertDefOperation ("Add Definition ...") the order of
the offered operations is reversed to better support the typical use
case of inserting the definition in the corresponding source file.

Change-Id: I0cc502663c43fdeb4773a99d2cd5ae8ddf62f9f0
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent 9003105f
......@@ -2550,6 +2550,7 @@ public:
if (m_defpos == DefPosImplementationFile) {
const QString declFile = QString::fromUtf8(decl->fileName(), decl->fileNameLength());
const QDir dir = QFileInfo(declFile).dir();
setPriority(2);
setDescription(QCoreApplication::translate("CppEditor::InsertDefOperation",
"Add Definition in %1")
.arg(dir.relativeFilePath(m_loc.isValid() ? m_loc.fileName()
......@@ -2561,6 +2562,7 @@ public:
setDescription(QCoreApplication::translate("CppEditor::InsertDefOperation",
"Add Definition Inside Class"));
} else if (m_defpos == DefPosOutsideClass) {
setPriority(1);
setDescription(QCoreApplication::translate("CppEditor::InsertDefOperation",
"Add Definition Outside Class"));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment