Commit 8c83a8f7 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Merge branch 'master' of ../mainline into genericprojectmanager

parents d690a844 4f4f1492
......@@ -21,7 +21,11 @@ qch_docs.commands = $$HELPGENERATOR -o $$QCH_FILE $$QHP_FILE
qch_docs.depends += html_docs
qch_docs.files = $$QCH_FILE
linux-* {
unix:!macx {
system("mkdir -p `dirname $$QCH_FILE` && touch $$QCH_FILE")
}
unix:!macx {
qch_docs.path = /share/doc/qtcreator
INSTALLS += qch_docs
}
......
......@@ -84,6 +84,7 @@ void CMakeProject::parseCMakeLists()
QString sourceDirectory = QFileInfo(m_fileName).absolutePath();
QString cbpFile = CMakeManager::findCbpFile(buildDirectory(activeBuildConfiguration()));
m_rootNode->setFolderName(QFileInfo(cbpFile).baseName());
CMakeCbpParser cbpparser;
qDebug()<<"Parsing file "<<cbpFile;
if (cbpparser.parseCbpFile(cbpFile)) {
......@@ -112,6 +113,7 @@ void CMakeProject::parseCMakeLists()
QList<ProjectExplorer::FileNode *> fileList = cbpparser.fileList();
// Manually add the CMakeLists.txt file
fileList.append(new ProjectExplorer::FileNode(sourceDirectory + "/CMakeLists.txt", ProjectExplorer::ProjectFileType, false));
buildTree(m_rootNode, fileList);
foreach (ProjectExplorer::FileNode *fn, fileList)
m_files.append(fn->path());
......@@ -309,6 +311,7 @@ MakeStep *CMakeProject::makeStep() const
return 0;
}
void CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &reader)
{
Project::restoreSettingsImpl(reader);
......@@ -341,7 +344,6 @@ void CMakeProject::restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader
}
parseCMakeLists(); // Gets the directory from the active buildconfiguration
if (!hasUserFile) {
......
......@@ -37,6 +37,8 @@ namespace Internal {
class CMakeProjectNode : public ProjectExplorer::ProjectNode
{
Q_OBJECT
friend class CMakeProject;
public:
CMakeProjectNode(const QString &fileName);
virtual bool hasTargets() const;
......@@ -52,10 +54,6 @@ public:
virtual bool renameFile(const ProjectExplorer::FileType fileType,
const QString &filePath,
const QString &newFilePath);
// TODO is protected in base class, and that's correct
using ProjectNode::addFileNodes;
using ProjectNode::addFolderNodes;
};
} // namespace Internal
......
......@@ -332,36 +332,36 @@ Layout BOTTOM - Recent Projects und Recent Sessions
/*Recent Projects*/
.layout_bottom .rec_proj_container{
width:50%;
float:left;
margin-left:50%;
}
.layout_bottom .rec_proj_container .rec_proj_box{
margin-right:10px;
}
margin-left:10px;
}
/*Recent Sessions*/
.layout_bottom .rec_sess_container{
margin-left:50%;
width:50%;
float:left;
}
.layout_bottom .rec_sess_container .rec_sess_box{
margin-left:10px;
margin-right:10px;
}
/*Restore Session Button inlusive CSS HOVER*/
a.restore_session{
float:right;
float:right;
display:block;
background-image:url(images/btn_restore_session.png);
width:137px;
......
......@@ -52,11 +52,9 @@
<!-- BOTTOM - Recent Projects und Recent Sessions -->
<div class="layout_bottom">
<!-- RECENT PROJECTS -->
<!-- RECENT SESSIONS -->
<!-- RECENT PROJECTS -->
<!-- clear floating of sessions and projects -->
<div class="clear_left"></div>
......
......@@ -51,6 +51,25 @@ public:
virtual QString contextHelpId() const { return QString(); }
};
class BaseContext : public Core::IContext
{
public:
BaseContext(QWidget *widget, const QList<int> &context, QObject *parent = 0)
: Core::IContext(parent),
m_widget(widget),
m_context(context)
{
}
QList<int> context() const { return m_context; }
QWidget *widget() { return m_widget; }
private:
QWidget *m_widget;
QList<int> m_context;
};
} // namespace Core
#endif //ICONTEXT_H
......@@ -374,6 +374,17 @@ void HelpPlugin::createRightPaneSideBar()
m_helpViewerForSideBar = new HelpViewer(m_helpEngine, 0);
rightPaneLayout->addWidget(m_helpViewerForSideBar);
m_core->addContextObject(new Core::BaseContext(m_helpViewerForSideBar, QList<int>()
<< m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR),
this));
QAction *copyActionSideBar = new QAction(this);
Core::Command *cmd = m_core->actionManager()->registerAction(copyActionSideBar,
Core::Constants::COPY, QList<int>()
<< m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR));
connect(copyActionSideBar, SIGNAL(triggered()), this, SLOT(copyFromSideBar()));
copyActionSideBar->setText(cmd->action()->text());
copyActionSideBar->setIcon(cmd->action()->icon());
m_rightPaneSideBar = new QWidget;
m_rightPaneSideBar->setLayout(rightPaneLayout);
......@@ -381,6 +392,11 @@ void HelpPlugin::createRightPaneSideBar()
addAutoReleasedObject(new Core::BaseRightPaneWidget(m_rightPaneSideBar));
}
void HelpPlugin::copyFromSideBar()
{
m_helpViewerForSideBar->copy();
}
void HelpPlugin::rightPaneBackward()
{
m_helpViewerForSideBar->backward();
......
......@@ -64,10 +64,10 @@ class SideBarItem;
namespace Help {
namespace Constants {
const char * const HELPVIEWER_KIND = "Qt Help Viewer";
const char * const C_MODE_HELP = "Help Mode";
const int P_MODE_HELP = 70;
const char * const ID_MODE_HELP = "Help";
const char * const C_MODE_HELP = "Help Mode";
const char * const C_HELP_SIDEBAR = "Help Sidebar";
const int P_MODE_HELP = 70;
const char * const ID_MODE_HELP = "Help";
}
class HELP_EXPORT HelpManager : public QObject
......@@ -124,6 +124,7 @@ private slots:
void switchToHelpMode(const QUrl &source);
void switchToHelpMode(const QMap<QString, QUrl> &urls, const QString &keyword);
void slotHideRightPane();
void copyFromSideBar();
void openGettingStarted();
......
......@@ -386,14 +386,30 @@ void ProjectNode::addFolderNodes(const QList<FolderNode*> &subFolders, FolderNod
qDebug("Project node has already a parent folder"));
folder->setParentFolderNode(parentFolder);
folder->setProjectNode(this);
parentFolder->m_subFolderNodes.append(folder);
// Find the correct place to insert
if (parentFolder->m_subFolderNodes.count() == 0 || sortNodesByPath(parentFolder->m_subFolderNodes.last(), folder)) {
// empty list or greater then last node
parentFolder->m_subFolderNodes.append(folder);
} else {
// Binary Search for insertion point
int l = 0;
int r = parentFolder->m_subFolderNodes.count();
while (l != r) {
int i = (l + r) / 2;
if (sortNodesByPath(folder, parentFolder->m_subFolderNodes.at(i))) {
r = i;
} else {
l = i + 1;
}
}
parentFolder->m_subFolderNodes.insert(l, folder);
}
// project nodes have to be added via addProjectNodes
QTC_ASSERT(folder->nodeType() != ProjectNodeType,
qDebug("project nodes have to be added via addProjectNodes"));
}
qSort(parentFolder->m_subFolderNodes.begin(), parentFolder->m_subFolderNodes.end(),
sortNodesByPath);
if (emitSignals)
foreach (NodesWatcher *watcher, m_watchers)
......@@ -461,9 +477,25 @@ void ProjectNode::addFileNodes(const QList<FileNode*> &files, FolderNode *folder
file->setParentFolderNode(folder);
file->setProjectNode(this);
folder->m_fileNodes.append(file);
// Now find the correct place to insert file
if (folder->m_fileNodes.count() == 0 || sortNodesByPath(folder->m_fileNodes.last(), file)) {
// empty list or greater then last node
folder->m_fileNodes.append(file);
} else {
// Binary Search for insertion point
int l = 0;
int r = folder->m_fileNodes.count();
while (l != r) {
int i = (l + r) / 2;
if (sortNodesByPath(file, folder->m_fileNodes.at(i))) {
r = i;
} else {
l = i + 1;
}
}
folder->m_fileNodes.insert(l, file);
}
}
qSort(folder->m_fileNodes.begin(), folder->m_fileNodes.end(), sortNodesByPath);
if (emitSignals)
foreach (NodesWatcher *watcher, m_watchers)
......
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