2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2013-10-16 12:10:22 +02:00
|
|
|
#include "qmakenodes.h"
|
|
|
|
|
#include "qmakeproject.h"
|
2012-04-24 15:49:09 +02:00
|
|
|
#include "qmakerunconfigurationfactory.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2017-02-24 18:01:54 +01:00
|
|
|
#include <projectexplorer/buildconfiguration.h>
|
2012-04-24 15:49:09 +02:00
|
|
|
#include <projectexplorer/target.h>
|
2014-02-18 21:38:03 +01:00
|
|
|
#include <resourceeditor/resourcenode.h>
|
|
|
|
|
|
2010-08-24 18:22:57 +02:00
|
|
|
#include <utils/stringutils.h>
|
2008-12-09 15:25:01 +01:00
|
|
|
|
2015-02-01 18:44:47 +02:00
|
|
|
using namespace ProjectExplorer;
|
Implement theming for QtCreator
Adds a 'Theme' tab to the environment settings and a '-theme' command
line option.
A theme is a combination of colors, gradients, flags and style
information.
There are two themes:
- 'default': preserves the current default look
- 'dark': uses a more flat for many widgets, dark color theme
for everything
This does not use a stylesheet (too limited), but rather sets
the palette via C++ and modifies drawing behavior.
Overall, the look is more flat (removed some gradients and bevels).
Tested on Ubuntu 14.04 using Qt 5.4 and running on a KDE
Desktop (Oxygen base style).
For a screenshot, see
https://gist.github.com/thorbenk/5ab06bea726de0aa7473
Changes:
- Introduce class Theme, defining the interface how to access theme
specific settings. The class reads a .creatortheme file (INI file, via
QSettings)
- Define named colors in the [Palette] section
(see dark.creatortheme for example usage)
- Use either named colors of AARRGGBB (hex) in the [Colors]
section
- A file ending with .creatortheme may be supplied
to the '-theme' command line option
- A global Theme instance can be accessed via creatorTheme()
- Query colors, gradients, icons and flags from the theme
were possible (TODO: use this in more places...)
- There are very many color roles. It seems better to me
to describe the role clearly, and then to consolidate later
in the actual theme by assigning the same color.
For example, one can set the text color of the output pane button
individualy.
- Many elements are also drawn differently.
For the dark theme, I wanted to have a flatter look.
- Introduce Theme::WidgetStyle enum, for now {Original, Flat}.
- The theme specifies which kind of widget style it wants.
- The drawing code queries the theme's style flag and
switches between the original, gradient based look and
the new, flat look.
- Create some custom icons which look better on dark background
(wip, currently folder/file icons)
- Let ManhattanStyle draw some elements for non-panelwidgets, too
(open/close arrows in QTreeView, custom folder/file icons)
- For the welcomescreen, pass the WelcomeTheme class.
WelcomeTheme exposes theme colors as Q_PROPERTY accessible from
.qml
- Themes can be modified via the 'Themes' tab in the environment
settings.
TODO:
* Unify image handling
* Avoid style name references
* Fix gradients
Change-Id: I92c2050ab0fb327649ea1eff4adec973d2073944
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-10-14 19:09:48 +02:00
|
|
|
using namespace Utils;
|
2010-01-20 14:47:08 +01:00
|
|
|
|
2014-09-10 12:53:55 +02:00
|
|
|
namespace QmakeProjectManager {
|
2010-03-10 16:55:37 +01:00
|
|
|
|
2017-02-02 11:06:50 +01:00
|
|
|
/*!
|
|
|
|
|
\class QmakePriFileNode
|
|
|
|
|
Implements abstract ProjectNode class
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
QmakePriFileNode::QmakePriFileNode(QmakeProject *project, QmakeProFileNode *qmakeProFileNode,
|
2017-02-10 11:16:18 +01:00
|
|
|
const FileName &filePath) :
|
|
|
|
|
ProjectNode(filePath),
|
|
|
|
|
m_project(project),
|
|
|
|
|
m_qmakeProFileNode(qmakeProFileNode)
|
|
|
|
|
{ }
|
2010-08-10 16:27:35 +02:00
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakePriFile *QmakePriFileNode::priFile() const
|
2010-08-10 16:27:35 +02:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
return m_project->rootProFile()->findPriFile(filePath());
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
bool QmakePriFileNode::deploysFolder(const QString &folder) const
|
2010-08-24 17:17:11 +02:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakePriFile *pri = priFile();
|
|
|
|
|
return pri ? pri->deploysFolder(folder) : false;
|
2010-08-24 17:17:11 +02:00
|
|
|
}
|
|
|
|
|
|
2015-02-01 18:44:47 +02:00
|
|
|
QList<RunConfiguration *> QmakePriFileNode::runConfigurations() const
|
2011-01-20 18:05:58 +01:00
|
|
|
{
|
2012-04-24 15:49:09 +02:00
|
|
|
QmakeRunConfigurationFactory *factory = QmakeRunConfigurationFactory::find(m_project->activeTarget());
|
|
|
|
|
if (factory)
|
2014-04-29 08:35:00 +02:00
|
|
|
return factory->runConfigurationsForNode(m_project->activeTarget(), this);
|
2015-02-01 18:44:47 +02:00
|
|
|
return QList<RunConfiguration *>();
|
2011-01-20 18:05:58 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
QmakeProFileNode *QmakePriFileNode::proFileNode() const
|
2013-10-28 19:42:56 +02:00
|
|
|
{
|
2013-10-29 14:22:31 +01:00
|
|
|
return m_qmakeProFileNode;
|
2013-10-28 19:42:56 +02:00
|
|
|
}
|
|
|
|
|
|
2015-02-01 18:44:47 +02:00
|
|
|
QList<ProjectAction> QmakePriFileNode::supportedActions(Node *node) const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2015-02-01 18:44:47 +02:00
|
|
|
QList<ProjectAction> actions;
|
2008-12-05 14:29:18 +01:00
|
|
|
|
|
|
|
|
const FolderNode *folderNode = this;
|
2013-10-29 14:22:31 +01:00
|
|
|
const QmakeProFileNode *proFileNode;
|
2015-01-09 15:50:06 +01:00
|
|
|
while (!(proFileNode = dynamic_cast<const QmakeProFileNode*>(folderNode)))
|
2008-12-05 14:29:18 +01:00
|
|
|
folderNode = folderNode->parentFolderNode();
|
2008-12-17 15:51:48 +01:00
|
|
|
Q_ASSERT(proFileNode);
|
2017-02-10 11:16:18 +01:00
|
|
|
const QmakeProFile *pro = proFileNode->proFile();
|
2008-12-05 14:29:18 +01:00
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
switch (pro ? pro->projectType() : ProjectType::Invalid) {
|
2017-02-09 13:56:22 +01:00
|
|
|
case ProjectType::ApplicationTemplate:
|
|
|
|
|
case ProjectType::StaticLibraryTemplate:
|
|
|
|
|
case ProjectType::SharedLibraryTemplate:
|
|
|
|
|
case ProjectType::AuxTemplate: {
|
2011-05-05 17:42:35 +02:00
|
|
|
// TODO: Some of the file types don't make much sense for aux
|
|
|
|
|
// projects (e.g. cpp). It'd be nice if the "add" action could
|
|
|
|
|
// work on a subset of the file types according to project type.
|
|
|
|
|
|
2015-02-01 18:44:47 +02:00
|
|
|
actions << AddNewFile;
|
2017-02-10 11:16:18 +01:00
|
|
|
if (pro && pro->knowsFile(node->filePath()))
|
2015-02-01 18:44:47 +02:00
|
|
|
actions << EraseFile;
|
Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
# skip ast (excluding paste, astpath, and canv'ast'imer)
next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
s = File.read(file)
next if s.include?('qlalr')
orig = s.dup
s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
res = $&
if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
res
else
res.gsub!('} else', 'else')
res.gsub!(/\n +} *\n/m, "\n")
res.gsub(/ *{$/, '')
end
}
s.gsub!(/ *$/, '')
File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-08 03:32:53 +02:00
|
|
|
else
|
2015-02-01 18:44:47 +02:00
|
|
|
actions << RemoveFile;
|
2010-08-24 17:17:11 +02:00
|
|
|
|
2010-08-24 18:22:57 +02:00
|
|
|
bool addExistingFiles = true;
|
2016-10-31 13:33:13 +01:00
|
|
|
if (node->nodeType() == NodeType::VirtualFolder) {
|
2010-08-24 18:22:57 +02:00
|
|
|
// A virtual folder, we do what the projectexplorer does
|
2015-02-18 13:10:40 +01:00
|
|
|
FolderNode *folder = node->asFolderNode();
|
2010-08-24 18:22:57 +02:00
|
|
|
if (folder) {
|
|
|
|
|
QStringList list;
|
2016-11-09 12:28:25 +01:00
|
|
|
foreach (FolderNode *f, folder->folderNodes())
|
2015-10-29 17:53:47 +01:00
|
|
|
list << f->filePath().toString() + QLatin1Char('/');
|
2010-08-24 18:22:57 +02:00
|
|
|
if (deploysFolder(Utils::commonPath(list)))
|
|
|
|
|
addExistingFiles = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-29 17:53:47 +01:00
|
|
|
addExistingFiles = addExistingFiles && !deploysFolder(node->filePath().toString());
|
2010-08-24 18:22:57 +02:00
|
|
|
|
|
|
|
|
if (addExistingFiles)
|
2015-02-01 18:44:47 +02:00
|
|
|
actions << AddExistingFile << AddExistingDirectory;
|
2010-08-24 17:17:11 +02:00
|
|
|
|
2008-12-05 14:29:18 +01:00
|
|
|
break;
|
2010-08-24 18:22:57 +02:00
|
|
|
}
|
2017-02-09 13:56:22 +01:00
|
|
|
case ProjectType::SubDirsTemplate:
|
2015-02-01 18:44:47 +02:00
|
|
|
actions << AddSubProject << RemoveSubProject;
|
2008-12-05 14:29:18 +01:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
2010-05-11 14:13:38 +02:00
|
|
|
|
2015-02-18 13:10:40 +01:00
|
|
|
FileNode *fileNode = node->asFileNode();
|
2016-10-31 13:47:42 +01:00
|
|
|
if ((fileNode && fileNode->fileType() != FileType::Project)
|
2016-04-08 16:25:29 +02:00
|
|
|
|| dynamic_cast<ResourceEditor::ResourceTopLevelNode *>(node)) {
|
2015-02-01 18:44:47 +02:00
|
|
|
actions << Rename;
|
2016-04-08 16:25:29 +02:00
|
|
|
actions << DuplicateFile;
|
|
|
|
|
}
|
2010-05-11 14:13:38 +02:00
|
|
|
|
2015-02-01 18:44:47 +02:00
|
|
|
Target *target = m_project->activeTarget();
|
2012-04-24 15:49:09 +02:00
|
|
|
QmakeRunConfigurationFactory *factory = QmakeRunConfigurationFactory::find(target);
|
|
|
|
|
if (factory && !factory->runConfigurationsForNode(target, node).isEmpty())
|
2015-02-01 18:44:47 +02:00
|
|
|
actions << HasSubProjectRunConfigurations;
|
2011-01-20 18:05:58 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
return actions;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
bool QmakePriFileNode::canAddSubProject(const QString &proFilePath) const
|
2010-08-26 18:33:16 +02:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakePriFile *pri = priFile();
|
|
|
|
|
return pri ? pri->canAddSubProject(proFilePath) : false;
|
2010-08-27 15:44:15 +02:00
|
|
|
}
|
|
|
|
|
|
2017-03-15 14:45:54 +01:00
|
|
|
bool QmakePriFileNode::addSubProject(const QString &proFilePath)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakePriFile *pri = priFile();
|
2017-03-15 14:45:54 +01:00
|
|
|
return pri ? pri->addSubProject(proFilePath) : false;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2017-03-15 14:45:54 +01:00
|
|
|
bool QmakePriFileNode::removeSubProject(const QString &proFilePath)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakePriFile *pri = priFile();
|
2017-03-15 14:45:54 +01:00
|
|
|
return pri ? pri->removeSubProjects(proFilePath) : false;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
bool QmakePriFileNode::addFiles(const QStringList &filePaths, QStringList *notAdded)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakePriFile *pri = priFile();
|
|
|
|
|
return pri ? pri->addFiles(filePaths, notAdded) : false;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
bool QmakePriFileNode::removeFiles(const QStringList &filePaths, QStringList *notRemoved)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakePriFile *pri = priFile();
|
|
|
|
|
return pri ? pri->removeFiles(filePaths, notRemoved) : false;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
bool QmakePriFileNode::deleteFiles(const QStringList &filePaths)
|
2010-08-10 16:27:35 +02:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakePriFile *pri = priFile();
|
|
|
|
|
return pri ? pri->deleteFiles(filePaths) : false;
|
2010-08-10 16:27:35 +02:00
|
|
|
}
|
|
|
|
|
|
2015-09-14 15:33:50 +02:00
|
|
|
bool QmakePriFileNode::canRenameFile(const QString &filePath, const QString &newFilePath)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakePriFile *pri = priFile();
|
|
|
|
|
return pri ? pri->canRenameFile(filePath, newFilePath) : false;
|
2015-09-14 15:33:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool QmakePriFileNode::renameFile(const QString &filePath, const QString &newFilePath)
|
|
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakePriFile *pri = priFile();
|
|
|
|
|
return pri ? pri->renameFile(filePath, newFilePath) : false;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2015-02-01 18:44:47 +02:00
|
|
|
FolderNode::AddNewInformation QmakePriFileNode::addNewInformation(const QStringList &files, Node *context) const
|
2014-02-18 16:31:36 +01:00
|
|
|
{
|
|
|
|
|
Q_UNUSED(files)
|
2016-11-09 13:39:59 +01:00
|
|
|
return FolderNode::AddNewInformation(filePath().fileName(), context && context->parentProjectNode() == this ? 120 : 90);
|
2014-02-18 16:31:36 +01:00
|
|
|
}
|
|
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakeProFileNode *QmakeProFileNode::findProFileFor(const FileName &fileName) const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
if (fileName == filePath())
|
|
|
|
|
return const_cast<QmakeProFileNode *>(this);
|
2017-02-23 10:52:00 +01:00
|
|
|
for (Node *node : nodes()) {
|
|
|
|
|
if (QmakeProFileNode *qmakeProFileNode = dynamic_cast<QmakeProFileNode *>(node))
|
2017-02-10 11:16:18 +01:00
|
|
|
if (QmakeProFileNode *result = qmakeProFileNode->findProFileFor(fileName))
|
|
|
|
|
return result;
|
2017-02-23 10:52:00 +01:00
|
|
|
}
|
2017-02-10 11:16:18 +01:00
|
|
|
return nullptr;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
/*!
|
|
|
|
|
\class QmakeProFileNode
|
|
|
|
|
Implements abstract ProjectNode class
|
|
|
|
|
*/
|
|
|
|
|
QmakeProFileNode::QmakeProFileNode(QmakeProject *project, const FileName &filePath) :
|
|
|
|
|
QmakePriFileNode(project, this, filePath)
|
|
|
|
|
{ }
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
bool QmakeProFileNode::showInSimpleTree() const
|
2010-06-08 12:15:43 +02:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
return showInSimpleTree(projectType()) || m_project->rootProjectNode() == this;
|
2010-06-08 12:15:43 +02:00
|
|
|
}
|
|
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakeProFile *QmakeProFileNode::proFile() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
return m_project->rootProFile()->findProFile(filePath());
|
2013-09-26 18:38:44 +02:00
|
|
|
}
|
2010-05-18 13:48:57 +02:00
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringList &files, Node *context) const
|
2013-09-26 18:38:44 +02:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
Q_UNUSED(files)
|
|
|
|
|
return AddNewInformation(filePath().fileName(), context && context->parentProjectNode() == this ? 120 : 100);
|
2013-09-26 18:38:44 +02:00
|
|
|
}
|
|
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
bool QmakeProFileNode::showInSimpleTree(ProjectType projectType) const
|
2015-09-14 15:33:50 +02:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
return projectType == ProjectType::ApplicationTemplate
|
|
|
|
|
|| projectType == ProjectType::SharedLibraryTemplate
|
|
|
|
|
|| projectType == ProjectType::StaticLibraryTemplate;
|
2015-09-14 15:33:50 +02:00
|
|
|
}
|
|
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
ProjectType QmakeProFileNode::projectType() const
|
2015-09-14 15:33:50 +02:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
const QmakeProFile *pro = proFile();
|
|
|
|
|
return pro ? pro->projectType() : ProjectType::Invalid;
|
2015-09-14 15:33:50 +02:00
|
|
|
}
|
|
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
QStringList QmakeProFileNode::variableValue(const Variable var) const
|
2013-09-26 18:38:44 +02:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
QmakeProFile *pro = proFile();
|
|
|
|
|
return pro ? pro->variableValue(var) : QStringList();
|
2013-09-26 18:38:44 +02:00
|
|
|
}
|
|
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
QString QmakeProFileNode::singleVariableValue(const Variable var) const
|
2013-09-26 18:38:44 +02:00
|
|
|
{
|
2017-02-10 11:16:18 +01:00
|
|
|
const QStringList &values = variableValue(var);
|
|
|
|
|
return values.isEmpty() ? QString() : values.first();
|
2013-09-26 18:38:44 +02:00
|
|
|
}
|
|
|
|
|
|
2017-02-24 18:01:54 +01:00
|
|
|
QString QmakeProFileNode::buildDir() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2017-02-24 18:01:54 +01:00
|
|
|
if (Target *target = m_project->activeTarget()) {
|
|
|
|
|
if (BuildConfiguration *bc = target->activeBuildConfiguration()) {
|
|
|
|
|
const QDir srcDirRoot(m_project->projectDirectory().toString());
|
|
|
|
|
const QString relativeDir = srcDirRoot.relativeFilePath(filePath().parentDir().toString());
|
|
|
|
|
return QDir::cleanPath(QDir(bc->buildDirectory().toString()).absoluteFilePath(relativeDir));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return QString();
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
} // namespace QmakeProjectManager
|