forked from qt-creator/qt-creator
some more whitespace changes
This commit is contained in:
@@ -222,7 +222,7 @@ void BinEditor::scrollContentsBy(int dx, int dy)
|
||||
void BinEditor::changeEvent(QEvent *e)
|
||||
{
|
||||
QAbstractScrollArea::changeEvent(e);
|
||||
if(e->type() == QEvent::ActivationChange) {
|
||||
if (e->type() == QEvent::ActivationChange) {
|
||||
if (!isActiveWindow())
|
||||
m_autoScrollTimer.stop();
|
||||
}
|
||||
@@ -450,7 +450,7 @@ void BinEditor::paintEvent(QPaintEvent *e)
|
||||
for (int c = 0; c < 16; ++c) {
|
||||
int pos = line * 16 + c;
|
||||
if (pos >= m_data.size()) {
|
||||
while(c < 16) {
|
||||
while (c < 16) {
|
||||
itemStringData[c*3] = itemStringData[c*3+1] = ' ';
|
||||
++c;
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ void BookmarkDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
||||
// int idx;
|
||||
// forever {
|
||||
// idx = directory.lastIndexOf("/", pos-1);
|
||||
// if(idx == -1) {
|
||||
// if (idx == -1) {
|
||||
// // Can't happen, this means the string did fit after all?
|
||||
// break;
|
||||
// }
|
||||
|
||||
@@ -58,7 +58,7 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName)
|
||||
CMakeCbpParser cbpparser;
|
||||
if (cbpparser.parseCbpFile(cbpFile)) {
|
||||
buildTree(m_rootNode, cbpparser.fileList());
|
||||
foreach(ProjectExplorer::FileNode *fn, cbpparser.fileList())
|
||||
foreach (ProjectExplorer::FileNode *fn, cbpparser.fileList())
|
||||
m_files.append(fn->path());
|
||||
m_files.sort();
|
||||
|
||||
@@ -87,11 +87,9 @@ QString CMakeProject::findCbpFile(const QDir &directory)
|
||||
// TODO the cbp file is named like the project() command in the CMakeList.txt file
|
||||
// so this method below could find the wrong cbp file, if the user changes the project()
|
||||
// name
|
||||
foreach(const QString &cbpFile , directory.entryList())
|
||||
{
|
||||
if (cbpFile.endsWith(".cbp")) {
|
||||
foreach (const QString &cbpFile , directory.entryList()) {
|
||||
if (cbpFile.endsWith(".cbp"))
|
||||
return directory.path() + "/" + cbpFile;
|
||||
}
|
||||
}
|
||||
return QString::null;
|
||||
}
|
||||
@@ -113,7 +111,7 @@ void CMakeProject::buildTree(CMakeProjectNode *rootNode, QList<ProjectExplorer::
|
||||
{
|
||||
//m_rootNode->addFileNodes(fileList, m_rootNode);
|
||||
qSort(list.begin(), list.end(), ProjectExplorer::ProjectNode::sortNodesByPath);
|
||||
foreach( ProjectExplorer::FileNode *fn, list) {
|
||||
foreach (ProjectExplorer::FileNode *fn, list) {
|
||||
// Get relative path to rootNode
|
||||
QString parentDir = QFileInfo(fn->path()).absolutePath();
|
||||
ProjectExplorer::FolderNode *folder = findOrCreateFolder(rootNode, parentDir);
|
||||
@@ -127,10 +125,10 @@ ProjectExplorer::FolderNode *CMakeProject::findOrCreateFolder(CMakeProjectNode *
|
||||
QString relativePath = QDir(QFileInfo(rootNode->path()).path()).relativeFilePath(directory);
|
||||
QStringList parts = relativePath.split("/");
|
||||
ProjectExplorer::FolderNode *parent = rootNode;
|
||||
foreach(const QString &part, parts) {
|
||||
foreach (const QString &part, parts) {
|
||||
// Find folder in subFolders
|
||||
bool found = false;
|
||||
foreach(ProjectExplorer::FolderNode *folder, parent->subFolderNodes()) {
|
||||
foreach (ProjectExplorer::FolderNode *folder, parent->subFolderNodes()) {
|
||||
if (QFileInfo(folder->path()).fileName() == part) {
|
||||
// yeah found something :)
|
||||
parent = folder;
|
||||
@@ -332,7 +330,7 @@ bool CMakeCbpParser::parseCbpFile(const QString &fileName)
|
||||
if (fi.exists() && fi.open(QFile::ReadOnly)) {
|
||||
setDevice(&fi);
|
||||
|
||||
while(!atEnd()) {
|
||||
while (!atEnd()) {
|
||||
readNext();
|
||||
if (name() == "CodeBlocks_project_file") {
|
||||
parseCodeBlocks_project_file();
|
||||
@@ -350,7 +348,7 @@ bool CMakeCbpParser::parseCbpFile(const QString &fileName)
|
||||
|
||||
void CMakeCbpParser::parseCodeBlocks_project_file()
|
||||
{
|
||||
while(!atEnd()) {
|
||||
while (!atEnd()) {
|
||||
readNext();
|
||||
if (isEndElement()) {
|
||||
return;
|
||||
@@ -364,7 +362,7 @@ void CMakeCbpParser::parseCodeBlocks_project_file()
|
||||
|
||||
void CMakeCbpParser::parseProject()
|
||||
{
|
||||
while(!atEnd()) {
|
||||
while (!atEnd()) {
|
||||
readNext();
|
||||
if (isEndElement()) {
|
||||
return;
|
||||
@@ -380,7 +378,7 @@ void CMakeCbpParser::parseProject()
|
||||
|
||||
void CMakeCbpParser::parseBuild()
|
||||
{
|
||||
while(!atEnd()) {
|
||||
while (!atEnd()) {
|
||||
readNext();
|
||||
if (isEndElement()) {
|
||||
return;
|
||||
@@ -396,7 +394,7 @@ void CMakeCbpParser::parseTarget()
|
||||
{
|
||||
m_targetOutput.clear();
|
||||
m_targetType = false;
|
||||
while(!atEnd()) {
|
||||
while (!atEnd()) {
|
||||
readNext();
|
||||
if (isEndElement()) {
|
||||
if (m_targetType && !m_targetOutput.isEmpty()) {
|
||||
@@ -420,7 +418,7 @@ void CMakeCbpParser::parseTargetOption()
|
||||
m_targetOutput = attributes().value("output").toString();
|
||||
else if (attributes().hasAttribute("type") && attributes().value("type") == "1")
|
||||
m_targetType = true;
|
||||
while(!atEnd()) {
|
||||
while (!atEnd()) {
|
||||
readNext();
|
||||
if (isEndElement()) {
|
||||
return;
|
||||
@@ -432,7 +430,7 @@ void CMakeCbpParser::parseTargetOption()
|
||||
|
||||
void CMakeCbpParser::parseCompiler()
|
||||
{
|
||||
while(!atEnd()) {
|
||||
while (!atEnd()) {
|
||||
readNext();
|
||||
if (isEndElement()) {
|
||||
return;
|
||||
@@ -447,7 +445,7 @@ void CMakeCbpParser::parseCompiler()
|
||||
void CMakeCbpParser::parseAdd()
|
||||
{
|
||||
m_includeFiles.append(attributes().value("directory").toString());
|
||||
while(!atEnd()) {
|
||||
while (!atEnd()) {
|
||||
readNext();
|
||||
if (isEndElement()) {
|
||||
return;
|
||||
@@ -463,7 +461,7 @@ void CMakeCbpParser::parseUnit()
|
||||
QString fileName = attributes().value("filename").toString();
|
||||
if (!fileName.endsWith(".rule"))
|
||||
m_fileList.append( new ProjectExplorer::FileNode(fileName, ProjectExplorer::SourceType, false));
|
||||
while(!atEnd()) {
|
||||
while (!atEnd()) {
|
||||
readNext();
|
||||
if (isEndElement()) {
|
||||
return;
|
||||
|
||||
@@ -456,7 +456,7 @@ QStringList BaseFileWizard::runWizard(const QString &path, QWidget *parent)
|
||||
}
|
||||
}
|
||||
if (firstExtensionPageHit)
|
||||
foreach(IFileWizardExtension *ex, extensions)
|
||||
foreach (IFileWizardExtension *ex, extensions)
|
||||
ex->firstExtensionPageShown(files);
|
||||
if (accepted)
|
||||
break;
|
||||
@@ -486,7 +486,7 @@ QStringList BaseFileWizard::runWizard(const QString &path, QWidget *parent)
|
||||
}
|
||||
}
|
||||
// Run the extensions
|
||||
foreach(IFileWizardExtension *ex, extensions)
|
||||
foreach (IFileWizardExtension *ex, extensions)
|
||||
if (!ex->process(files, &errorMessage)) {
|
||||
QMessageBox::critical(parent, tr("File Generation Failure"), errorMessage);
|
||||
return QStringList();
|
||||
|
||||
@@ -58,7 +58,7 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &initialCategory,
|
||||
CoreImpl::instance()->pluginManager()->getObjects<IOptionsPage>();
|
||||
|
||||
int index = 0;
|
||||
foreach(IOptionsPage *page, pages) {
|
||||
foreach (IOptionsPage *page, pages) {
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem();
|
||||
item->setText(0, page->name());
|
||||
item->setData(0, Qt::UserRole, index);
|
||||
@@ -77,7 +77,7 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &initialCategory,
|
||||
|
||||
int catCount = 1;
|
||||
while (catCount < categoriesId.count()) {
|
||||
if(!categories.contains(currentCategory + QLatin1Char('|') + categoriesId.at(catCount))) {
|
||||
if (!categories.contains(currentCategory + QLatin1Char('|') + categoriesId.at(catCount))) {
|
||||
treeitem = new QTreeWidgetItem(categories.value(currentCategory));
|
||||
currentCategory += QLatin1Char('|') + categoriesId.at(catCount);
|
||||
treeitem->setText(0, trCategories.at(catCount));
|
||||
@@ -123,14 +123,14 @@ void SettingsDialog::pageSelected(QTreeWidgetItem *)
|
||||
|
||||
void SettingsDialog::accept()
|
||||
{
|
||||
foreach(IOptionsPage *page, m_pages)
|
||||
foreach (IOptionsPage *page, m_pages)
|
||||
page->finished(true);
|
||||
done(QDialog::Accepted);
|
||||
}
|
||||
|
||||
void SettingsDialog::reject()
|
||||
{
|
||||
foreach(IOptionsPage *page, m_pages)
|
||||
foreach (IOptionsPage *page, m_pages)
|
||||
page->finished(false);
|
||||
done(QDialog::Rejected);
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ QWidget *ShortcutSettings::createPage(QWidget *parent)
|
||||
void ShortcutSettings::finished(bool accepted)
|
||||
{
|
||||
if (accepted) {
|
||||
foreach(ShortcutItem *item, m_scitems) {
|
||||
foreach (ShortcutItem *item, m_scitems) {
|
||||
item->m_cmd->setKeySequence(item->m_key);
|
||||
}
|
||||
}
|
||||
@@ -196,7 +196,7 @@ bool ShortcutSettings::filter(const QString &f, const QTreeWidgetItem *item)
|
||||
if (f.isEmpty())
|
||||
return false;
|
||||
for (int i = 0; i < item->columnCount(); ++i) {
|
||||
if(item->text(i).contains(f, Qt::CaseInsensitive))
|
||||
if (item->text(i).contains(f, Qt::CaseInsensitive))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -242,7 +242,7 @@ void ShortcutSettings::importAction()
|
||||
CommandsFile cf(fileName);
|
||||
QMap<QString, QKeySequence> mapping = cf.importCommands();
|
||||
|
||||
foreach(ShortcutItem *item, m_scitems) {
|
||||
foreach (ShortcutItem *item, m_scitems) {
|
||||
QString sid = uidm->stringForUniqueIdentifier(item->m_cmd->id());
|
||||
if (mapping.contains(sid)) {
|
||||
item->m_key = mapping.value(sid);
|
||||
@@ -256,7 +256,7 @@ void ShortcutSettings::importAction()
|
||||
|
||||
void ShortcutSettings::defaultAction()
|
||||
{
|
||||
foreach(ShortcutItem *item, m_scitems) {
|
||||
foreach (ShortcutItem *item, m_scitems) {
|
||||
item->m_key = item->m_cmd->defaultKeySequence();
|
||||
item->m_item->setText(2, item->m_key);
|
||||
if (item->m_item == m_page->commandList->currentItem())
|
||||
|
||||
@@ -1089,7 +1089,7 @@ bool EditorManager::saveFileAs(IEditor *editor)
|
||||
const bool success = editor->file()->save(absoluteFilePath);
|
||||
m_d->m_core->fileManager()->unblockFileChange(editor->file());
|
||||
|
||||
if(success)
|
||||
if (success)
|
||||
m_d->m_core->fileManager()->addToRecentFiles(editor->file()->fileName());
|
||||
|
||||
updateActions();
|
||||
|
||||
@@ -70,7 +70,7 @@ OpenEditorsWidget::OpenEditorsWidget()
|
||||
m_ui.editorList->installEventFilter(this);
|
||||
m_ui.editorList->setFrameStyle(QFrame::NoFrame);
|
||||
EditorManager *em = EditorManager::instance();
|
||||
foreach(IEditor *editor, em->openedEditors()) {
|
||||
foreach (IEditor *editor, em->openedEditors()) {
|
||||
registerEditor(editor);
|
||||
}
|
||||
connect(em, SIGNAL(editorOpened(Core::IEditor*)),
|
||||
|
||||
@@ -96,7 +96,7 @@ void FileIconProvider::registerIconForSuffix(const QIcon &icon, const QString &s
|
||||
{
|
||||
// delete old icon, if it exists
|
||||
QList<QPair<QString,QIcon> >::iterator iter = m_cache.begin();
|
||||
for(; iter != m_cache.end(); ++iter) {
|
||||
for (; iter != m_cache.end(); ++iter) {
|
||||
if ((*iter).first == suffix) {
|
||||
iter = m_cache.erase(iter);
|
||||
break;
|
||||
@@ -118,7 +118,7 @@ QIcon FileIconProvider::iconForSuffix(const QString &suffix) const
|
||||
return icon;
|
||||
|
||||
QList<QPair<QString,QIcon> >::const_iterator iter = m_cache.constBegin();
|
||||
for(; iter != m_cache.constEnd(); ++iter) {
|
||||
for (; iter != m_cache.constEnd(); ++iter) {
|
||||
if ((*iter).first == suffix) {
|
||||
icon = (*iter).second;
|
||||
break;
|
||||
|
||||
@@ -896,7 +896,7 @@ void MainWindow::removeContextObject(IContext *context)
|
||||
return;
|
||||
|
||||
m_contextWidgets.remove(widget);
|
||||
if(m_activeContext == context)
|
||||
if (m_activeContext == context)
|
||||
updateContextObject(0);
|
||||
}
|
||||
|
||||
@@ -957,10 +957,11 @@ void MainWindow::resetContext()
|
||||
updateContextObject(0);
|
||||
}
|
||||
|
||||
QMenu *MainWindow::createPopupMenu() {
|
||||
QMenu *MainWindow::createPopupMenu()
|
||||
{
|
||||
QMenu *menu = new QMenu(this);
|
||||
QList<ActionContainer *> containers = m_actionManager->containers();
|
||||
foreach(ActionContainer *c, containers) {
|
||||
foreach (ActionContainer *c, containers) {
|
||||
if (c->toolBar())
|
||||
menu->addAction(c->toolBar()->toggleViewAction());
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ void drawCornerImage(const QImage &img, QPainter *painter, QRect rect,
|
||||
if (top > 0) { //top
|
||||
painter->drawImage(QRect(rect.left() + left, rect.top(), rect.width() -right - left, top), img,
|
||||
QRect(left, 0, size.width() -right - left, top));
|
||||
if(left > 0) //top-left
|
||||
if (left > 0) //top-left
|
||||
painter->drawImage(QRect(rect.left(), rect.top(), left, top), img,
|
||||
QRect(0, 0, left, top));
|
||||
if (right > 0) //top-right
|
||||
|
||||
@@ -299,7 +299,7 @@ void MimeTypeData::debug(QTextStream &str, int indent) const
|
||||
str << indentS << "SubClassesOf: " << subClassesOf.join(comma) << '\n';
|
||||
if (!globPatterns.empty()) {
|
||||
str << indentS << "Glob: ";
|
||||
foreach(const QRegExp &r, globPatterns)
|
||||
foreach (const QRegExp &r, globPatterns)
|
||||
str << r.pattern() << ' ';
|
||||
str << '\n';
|
||||
if (!suffixes.empty()) {
|
||||
|
||||
@@ -87,8 +87,8 @@ void NavigationWidgetPlaceHolder::applyStoredSize(int width)
|
||||
QList<int> sizes = splitter->sizes();
|
||||
int index = splitter->indexOf(this);
|
||||
int diff = width - sizes.at(index);
|
||||
int adjust = sizes.count() > 1? ( diff / (sizes.count() - 1)) : 0;
|
||||
for(int i=0; i<sizes.count(); ++i) {
|
||||
int adjust = sizes.count() > 1 ? (diff / (sizes.count() - 1)) : 0;
|
||||
for (int i = 0; i < sizes.count(); ++i) {
|
||||
if (i != index)
|
||||
sizes[i] += adjust;
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ void OutputPane::init(ICore *core, ExtensionSystem::PluginManager *pm)
|
||||
|
||||
connect(cmd->action(), SIGNAL(triggered()), this, SLOT(shortcutTriggered()));
|
||||
connect(cmd->action(), SIGNAL(changed()), this, SLOT(updateToolTip()));
|
||||
} while(it != begin);
|
||||
} while (it != begin);
|
||||
|
||||
changePage();
|
||||
}
|
||||
@@ -293,7 +293,7 @@ void OutputPane::shortcutTriggered()
|
||||
// but the outputpane doesn't have focus
|
||||
// then just give it focus
|
||||
// else do the same as clicking on the button does
|
||||
if(OutputPanePlaceHolder::m_current
|
||||
if (OutputPanePlaceHolder::m_current
|
||||
&& OutputPanePlaceHolder::m_current->isVisible()
|
||||
&& m_widgetComboBox->itemData(m_widgetComboBox->currentIndex()).toInt() == idx) {
|
||||
if (!outputPane->hasFocus() && outputPane->canFocus())
|
||||
|
||||
@@ -101,9 +101,9 @@ void ProgressBar::paintEvent(QPaintEvent *)
|
||||
double percent = 0.50;
|
||||
if (range != 0)
|
||||
percent = (value() - minimum()) / range;
|
||||
if(percent > 1)
|
||||
if (percent > 1)
|
||||
percent = 1;
|
||||
else if(percent < 0)
|
||||
else if (percent < 0)
|
||||
percent = 0;
|
||||
|
||||
QPainter p(this);
|
||||
|
||||
@@ -76,8 +76,8 @@ void RightPanePlaceHolder::applyStoredSize(int width)
|
||||
QList<int> sizes = splitter->sizes();
|
||||
int index = splitter->indexOf(this);
|
||||
int diff = width - sizes.at(index);
|
||||
int adjust = sizes.count() > 1? ( diff / (sizes.count() - 1)) : 0;
|
||||
for(int i=0; i<sizes.count(); ++i) {
|
||||
int adjust = sizes.count() > 1 ? (diff / (sizes.count() - 1)) : 0;
|
||||
for (int i = 0; i < sizes.count(); ++i) {
|
||||
if (i != index)
|
||||
sizes[i] -= adjust;
|
||||
}
|
||||
@@ -125,7 +125,7 @@ void RightPanePlaceHolder::currentModeChanged(Core::IMode *mode)
|
||||
RightPaneWidget *RightPaneWidget::m_instance = 0;
|
||||
|
||||
RightPaneWidget::RightPaneWidget()
|
||||
:m_shown(true), m_width(0)
|
||||
: m_shown(true), m_width(0)
|
||||
{
|
||||
m_instance = this;
|
||||
|
||||
|
||||
@@ -52,7 +52,8 @@ void Animation::paint(QPainter *painter, const QStyleOption *option)
|
||||
Q_UNUSED(painter);
|
||||
}
|
||||
|
||||
void Animation::drawBlendedImage(QPainter *painter, QRect rect, float alpha) {
|
||||
void Animation::drawBlendedImage(QPainter *painter, QRect rect, float alpha)
|
||||
{
|
||||
if (_secondaryImage.isNull() || _primaryImage.isNull())
|
||||
return;
|
||||
|
||||
@@ -64,7 +65,7 @@ void Animation::drawBlendedImage(QPainter *painter, QRect rect, float alpha) {
|
||||
const int sw = _primaryImage.width();
|
||||
const int sh = _primaryImage.height();
|
||||
const int bpl = _primaryImage.bytesPerLine();
|
||||
switch(_primaryImage.depth()) {
|
||||
switch (_primaryImage.depth()) {
|
||||
case 32:
|
||||
{
|
||||
uchar *mixed_data = _tempImage.bits();
|
||||
|
||||
@@ -77,7 +77,7 @@ void VCSManager::setVCSEnabled(const QString &directory)
|
||||
qDebug() << Q_FUNC_INFO << directory;
|
||||
IVersionControl* managingVCS = findVersionControlForDirectory(directory);
|
||||
const VersionControlList versionControls = allVersionControls();
|
||||
foreach(IVersionControl *versionControl, versionControls) {
|
||||
foreach (IVersionControl *versionControl, versionControls) {
|
||||
const bool newEnabled = versionControl == managingVCS;
|
||||
if (newEnabled != versionControl->isEnabled())
|
||||
versionControl->setEnabled(newEnabled);
|
||||
@@ -89,7 +89,7 @@ void VCSManager::setAllVCSEnabled()
|
||||
if (debug)
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
const VersionControlList versionControls = allVersionControls();
|
||||
foreach(IVersionControl *versionControl, versionControls)
|
||||
foreach (IVersionControl *versionControl, versionControls)
|
||||
if (!versionControl->isEnabled())
|
||||
versionControl->setEnabled(true);
|
||||
}
|
||||
@@ -106,7 +106,7 @@ IVersionControl* VCSManager::findVersionControlForDirectory(const QString &direc
|
||||
|
||||
int pos = 0;
|
||||
const QChar slash = QLatin1Char('/');
|
||||
while(true) {
|
||||
while (true) {
|
||||
int index = directory.indexOf(slash, pos);
|
||||
if (index == -1)
|
||||
break;
|
||||
@@ -119,7 +119,7 @@ IVersionControl* VCSManager::findVersionControlForDirectory(const QString &direc
|
||||
|
||||
// ah nothing so ask the IVersionControls directly
|
||||
const VersionControlList versionControls = allVersionControls();
|
||||
foreach(IVersionControl * versionControl, versionControls) {
|
||||
foreach (IVersionControl * versionControl, versionControls) {
|
||||
if (versionControl->managesDirectory(directory)) {
|
||||
m_d->m_cachedMatches.insert(versionControl->findTopLevelForDirectory(directory), versionControl);
|
||||
return versionControl;
|
||||
|
||||
@@ -152,13 +152,12 @@ void AttachExternalDialog::rebuildProcessList()
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
|
||||
// Forward declarations:
|
||||
BOOL GetProcessList( );
|
||||
BOOL ListProcessModules( DWORD dwPID );
|
||||
BOOL ListProcessThreads( DWORD dwOwnerPID );
|
||||
void printError( TCHAR* msg );
|
||||
BOOL GetProcessList();
|
||||
BOOL ListProcessModules(DWORD dwPID);
|
||||
BOOL ListProcessThreads(DWORD dwOwnerPID);
|
||||
void printError(TCHAR *msg);
|
||||
|
||||
BOOL GetProcessList( )
|
||||
BOOL GetProcessList()
|
||||
{
|
||||
HANDLE hProcessSnap;
|
||||
HANDLE hProcess;
|
||||
@@ -167,7 +166,7 @@ BOOL GetProcessList( )
|
||||
|
||||
// Take a snapshot of all processes in the system.
|
||||
hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
|
||||
if( hProcessSnap == INVALID_HANDLE_VALUE )
|
||||
if (hProcessSnap == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
printError( TEXT("CreateToolhelp32Snapshot (of processes)") );
|
||||
return( FALSE );
|
||||
@@ -178,7 +177,7 @@ BOOL GetProcessList( )
|
||||
|
||||
// Retrieve information about the first process,
|
||||
// and exit if unsuccessful
|
||||
if( !Process32First( hProcessSnap, &pe32 ) )
|
||||
if (!Process32First( hProcessSnap, &pe32 ))
|
||||
{
|
||||
printError( TEXT("Process32First") ); // show cause of failure
|
||||
CloseHandle( hProcessSnap ); // clean the snapshot object
|
||||
@@ -196,12 +195,12 @@ BOOL GetProcessList( )
|
||||
// Retrieve the priority class.
|
||||
dwPriorityClass = 0;
|
||||
hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID );
|
||||
if( hProcess == NULL )
|
||||
if (hProcess == NULL)
|
||||
printError( TEXT("OpenProcess") );
|
||||
else
|
||||
{
|
||||
dwPriorityClass = GetPriorityClass( hProcess );
|
||||
if( !dwPriorityClass )
|
||||
if (!dwPriorityClass)
|
||||
printError( TEXT("GetPriorityClass") );
|
||||
CloseHandle( hProcess );
|
||||
}
|
||||
@@ -210,31 +209,30 @@ BOOL GetProcessList( )
|
||||
printf( "\n Thread count = %d", pe32.cntThreads );
|
||||
printf( "\n Parent process ID = 0x%08X", pe32.th32ParentProcessID );
|
||||
printf( "\n Priority base = %d", pe32.pcPriClassBase );
|
||||
if( dwPriorityClass )
|
||||
if (dwPriorityClass)
|
||||
printf( "\n Priority class = %d", dwPriorityClass );
|
||||
|
||||
// List the modules and threads associated with this process
|
||||
ListProcessModules( pe32.th32ProcessID );
|
||||
ListProcessThreads( pe32.th32ProcessID );
|
||||
|
||||
} while( Process32Next( hProcessSnap, &pe32 ) );
|
||||
} while (Process32Next(hProcessSnap, &pe32));
|
||||
|
||||
CloseHandle( hProcessSnap );
|
||||
return( TRUE );
|
||||
CloseHandle(hProcessSnap);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BOOL ListProcessModules( DWORD dwPID )
|
||||
BOOL ListProcessModules(DWORD dwPID)
|
||||
{
|
||||
HANDLE hModuleSnap = INVALID_HANDLE_VALUE;
|
||||
MODULEENTRY32 me32;
|
||||
|
||||
// Take a snapshot of all modules in the specified process.
|
||||
hModuleSnap = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, dwPID );
|
||||
if( hModuleSnap == INVALID_HANDLE_VALUE )
|
||||
{
|
||||
printError( TEXT("CreateToolhelp32Snapshot (of modules)") );
|
||||
return( FALSE );
|
||||
if (hModuleSnap == INVALID_HANDLE_VALUE) {
|
||||
printError(TEXT("CreateToolhelp32Snapshot (of modules)"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Set the size of the structure before using it.
|
||||
@@ -242,7 +240,7 @@ BOOL ListProcessModules( DWORD dwPID )
|
||||
|
||||
// Retrieve information about the first module,
|
||||
// and exit if unsuccessful
|
||||
if( !Module32First( hModuleSnap, &me32 ) )
|
||||
if (!Module32First( hModuleSnap, &me32))
|
||||
{
|
||||
printError( TEXT("Module32First") ); // show cause of failure
|
||||
CloseHandle( hModuleSnap ); // clean the snapshot object
|
||||
@@ -261,10 +259,10 @@ BOOL ListProcessModules( DWORD dwPID )
|
||||
printf( "\n Base address = 0x%08X", (DWORD) me32.modBaseAddr );
|
||||
printf( "\n Base size = %d", me32.modBaseSize );
|
||||
|
||||
} while( Module32Next( hModuleSnap, &me32 ) );
|
||||
} while (Module32Next(hModuleSnap, &me32));
|
||||
|
||||
CloseHandle( hModuleSnap );
|
||||
return( TRUE );
|
||||
CloseHandle(hModuleSnap);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL ListProcessThreads( DWORD dwOwnerPID )
|
||||
@@ -274,7 +272,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID )
|
||||
|
||||
// Take a snapshot of all running threads
|
||||
hThreadSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 );
|
||||
if( hThreadSnap == INVALID_HANDLE_VALUE )
|
||||
if (hThreadSnap == INVALID_HANDLE_VALUE)
|
||||
return( FALSE );
|
||||
|
||||
// Fill in the size of the structure before using it.
|
||||
@@ -282,7 +280,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID )
|
||||
|
||||
// Retrieve information about the first thread,
|
||||
// and exit if unsuccessful
|
||||
if( !Thread32First( hThreadSnap, &te32 ) )
|
||||
if (!Thread32First( hThreadSnap, &te32 ))
|
||||
{
|
||||
printError( TEXT("Thread32First") ); // show cause of failure
|
||||
CloseHandle( hThreadSnap ); // clean the snapshot object
|
||||
@@ -294,13 +292,13 @@ BOOL ListProcessThreads( DWORD dwOwnerPID )
|
||||
// associated with the specified process
|
||||
do
|
||||
{
|
||||
if( te32.th32OwnerProcessID == dwOwnerPID )
|
||||
if (te32.th32OwnerProcessID == dwOwnerPID)
|
||||
{
|
||||
printf( "\n\n THREAD ID = 0x%08X", te32.th32ThreadID );
|
||||
printf( "\n Base priority = %d", te32.tpBasePri );
|
||||
printf( "\n Delta priority = %d", te32.tpDeltaPri );
|
||||
}
|
||||
} while( Thread32Next(hThreadSnap, &te32 ) );
|
||||
} while (Thread32Next(hThreadSnap, &te32));
|
||||
|
||||
CloseHandle( hThreadSnap );
|
||||
return( TRUE );
|
||||
@@ -308,22 +306,24 @@ BOOL ListProcessThreads( DWORD dwOwnerPID )
|
||||
|
||||
void printError( TCHAR* msg )
|
||||
{
|
||||
DWORD eNum;
|
||||
TCHAR sysMsg[256];
|
||||
TCHAR* p;
|
||||
DWORD eNum;
|
||||
TCHAR sysMsg[256];
|
||||
TCHAR* p;
|
||||
|
||||
eNum = GetLastError( );
|
||||
FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
eNum = GetLastError( );
|
||||
FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL, eNum,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
|
||||
sysMsg, 256, NULL );
|
||||
|
||||
// Trim the end of the line and terminate it with a null
|
||||
p = sysMsg;
|
||||
while( ( *p > 31 ) || ( *p == 9 ) )
|
||||
++p;
|
||||
do { *p-- = 0; } while( ( p >= sysMsg ) &&
|
||||
( ( *p == '.' ) || ( *p < 33 ) ) );
|
||||
// Trim the end of the line and terminate it with a null
|
||||
p = sysMsg;
|
||||
while (*p > 31 || *p == 9 )
|
||||
++p;
|
||||
|
||||
do {
|
||||
*p-- = 0;
|
||||
} while( p >= sysMsg && (*p == '.' || *p < 33));
|
||||
|
||||
// Display the message
|
||||
_tprintf( TEXT("\n WARNING: %s failed with error %d (%s)"), msg, eNum, sysMsg );
|
||||
@@ -331,7 +331,6 @@ void printError( TCHAR* msg )
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void AttachExternalDialog::procSelected(const QModelIndex &index0)
|
||||
{
|
||||
QModelIndex index = index0.sibling(index0.row(), 0);
|
||||
|
||||
@@ -150,10 +150,10 @@ void AttachRemoteDialog::rebuildProcessList()
|
||||
#include <stdio.h>
|
||||
|
||||
// Forward declarations:
|
||||
BOOL GetProcessList( );
|
||||
BOOL ListProcessModules( DWORD dwPID );
|
||||
BOOL ListProcessThreads( DWORD dwOwnerPID );
|
||||
void printError( TCHAR* msg );
|
||||
BOOL GetProcessList();
|
||||
BOOL ListProcessModules(DWORD dwPID);
|
||||
BOOL ListProcessThreads(DWORD dwOwnerPID);
|
||||
void printError(TCHAR* msg);
|
||||
|
||||
BOOL GetProcessList( )
|
||||
{
|
||||
@@ -164,7 +164,7 @@ BOOL GetProcessList( )
|
||||
|
||||
// Take a snapshot of all processes in the system.
|
||||
hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
|
||||
if( hProcessSnap == INVALID_HANDLE_VALUE )
|
||||
if (hProcessSnap == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
printError( TEXT("CreateToolhelp32Snapshot (of processes)") );
|
||||
return( FALSE );
|
||||
@@ -175,7 +175,7 @@ BOOL GetProcessList( )
|
||||
|
||||
// Retrieve information about the first process,
|
||||
// and exit if unsuccessful
|
||||
if( !Process32First( hProcessSnap, &pe32 ) )
|
||||
if (!Process32First( hProcessSnap, &pe32 ))
|
||||
{
|
||||
printError( TEXT("Process32First") ); // show cause of failure
|
||||
CloseHandle( hProcessSnap ); // clean the snapshot object
|
||||
@@ -193,12 +193,12 @@ BOOL GetProcessList( )
|
||||
// Retrieve the priority class.
|
||||
dwPriorityClass = 0;
|
||||
hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID );
|
||||
if( hProcess == NULL )
|
||||
if (hProcess == NULL)
|
||||
printError( TEXT("OpenProcess") );
|
||||
else
|
||||
{
|
||||
dwPriorityClass = GetPriorityClass( hProcess );
|
||||
if( !dwPriorityClass )
|
||||
if (!dwPriorityClass)
|
||||
printError( TEXT("GetPriorityClass") );
|
||||
CloseHandle( hProcess );
|
||||
}
|
||||
@@ -207,7 +207,7 @@ BOOL GetProcessList( )
|
||||
printf( "\n Thread count = %d", pe32.cntThreads );
|
||||
printf( "\n Parent process ID = 0x%08X", pe32.th32ParentProcessID );
|
||||
printf( "\n Priority base = %d", pe32.pcPriClassBase );
|
||||
if( dwPriorityClass )
|
||||
if (dwPriorityClass)
|
||||
printf( "\n Priority class = %d", dwPriorityClass );
|
||||
|
||||
// List the modules and threads associated with this process
|
||||
@@ -228,7 +228,7 @@ BOOL ListProcessModules( DWORD dwPID )
|
||||
|
||||
// Take a snapshot of all modules in the specified process.
|
||||
hModuleSnap = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, dwPID );
|
||||
if( hModuleSnap == INVALID_HANDLE_VALUE )
|
||||
if (hModuleSnap == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
printError( TEXT("CreateToolhelp32Snapshot (of modules)") );
|
||||
return( FALSE );
|
||||
@@ -239,7 +239,7 @@ BOOL ListProcessModules( DWORD dwPID )
|
||||
|
||||
// Retrieve information about the first module,
|
||||
// and exit if unsuccessful
|
||||
if( !Module32First( hModuleSnap, &me32 ) )
|
||||
if (!Module32First( hModuleSnap, &me32 ))
|
||||
{
|
||||
printError( TEXT("Module32First") ); // show cause of failure
|
||||
CloseHandle( hModuleSnap ); // clean the snapshot object
|
||||
@@ -271,7 +271,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID )
|
||||
|
||||
// Take a snapshot of all running threads
|
||||
hThreadSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 );
|
||||
if( hThreadSnap == INVALID_HANDLE_VALUE )
|
||||
if (hThreadSnap == INVALID_HANDLE_VALUE)
|
||||
return( FALSE );
|
||||
|
||||
// Fill in the size of the structure before using it.
|
||||
@@ -279,7 +279,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID )
|
||||
|
||||
// Retrieve information about the first thread,
|
||||
// and exit if unsuccessful
|
||||
if( !Thread32First( hThreadSnap, &te32 ) )
|
||||
if (!Thread32First( hThreadSnap, &te32 ))
|
||||
{
|
||||
printError( TEXT("Thread32First") ); // show cause of failure
|
||||
CloseHandle( hThreadSnap ); // clean the snapshot object
|
||||
@@ -291,7 +291,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID )
|
||||
// associated with the specified process
|
||||
do
|
||||
{
|
||||
if( te32.th32OwnerProcessID == dwOwnerPID )
|
||||
if (te32.th32OwnerProcessID == dwOwnerPID)
|
||||
{
|
||||
printf( "\n\n THREAD ID = 0x%08X", te32.th32ThreadID );
|
||||
printf( "\n Base priority = %d", te32.tpBasePri );
|
||||
|
||||
@@ -59,10 +59,10 @@ TypeMacroPage::TypeMacroPage(GdbSettings *settings)
|
||||
//insert qt4 defaults
|
||||
m_settings->m_scriptFile = coreIFace->resourcePath() +
|
||||
QLatin1String("/gdb/qt4macros");
|
||||
for (int i=0; i<3; ++i) {
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
QByteArray data;
|
||||
QDataStream stream(&data, QIODevice::WriteOnly);
|
||||
switch(i) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
stream << QString("printqstring") << (int)1;
|
||||
m_settings->m_typeMacros.insert(QLatin1String("QString"), data);
|
||||
@@ -154,7 +154,7 @@ void TypeMacroPage::finished(bool accepted)
|
||||
m_settings->m_typeMacros.clear();
|
||||
m_settings->m_scriptFile = m_ui.scriptEdit->text();
|
||||
|
||||
for (int i=0; i<m_ui.treeWidget->topLevelItemCount(); ++i) {
|
||||
for (int i = 0; i < m_ui.treeWidget->topLevelItemCount(); ++i) {
|
||||
QTreeWidgetItem *item = m_ui.treeWidget->topLevelItem(i);
|
||||
QByteArray data;
|
||||
QDataStream stream(&data, QIODevice::WriteOnly);
|
||||
|
||||
@@ -88,7 +88,7 @@ QString StartExternalDialog::executableArguments() const
|
||||
result << QLatin1String("--args");
|
||||
result << execEdit->text();
|
||||
|
||||
for(int i=0; i<args.length(); ++i) {
|
||||
for (int i = 0; i < args.length(); ++i) {
|
||||
current = args.at(i);
|
||||
|
||||
if (current == QLatin1Char('\"') && last != QLatin1Char('\\')) {
|
||||
|
||||
@@ -156,7 +156,7 @@ bool FormClassWizardParameters::generateCpp(QString *header, QString *source, in
|
||||
if (languageChange) {
|
||||
sourceStr << '\n' << namespaceIndent << "void " << unqualifiedClassName << "::" << "changeEvent(QEvent *e)\n"
|
||||
<< namespaceIndent << "{\n"
|
||||
<< namespaceIndent << indent << "switch(e->type()) {\n" << namespaceIndent << indent << "case QEvent::LanguageChange:\n"
|
||||
<< namespaceIndent << indent << "switch (e->type()) {\n" << namespaceIndent << indent << "case QEvent::LanguageChange:\n"
|
||||
<< namespaceIndent << indent << indent;
|
||||
if (embedding != InheritedUiClass)
|
||||
sourceStr << uiMemberC << (embedding == PointerAggregatedUiClass ? "->" : ".");
|
||||
|
||||
@@ -472,7 +472,7 @@ Core::IActionContainer *FormEditorW::createPreviewStyleMenu(Core::ActionManagerI
|
||||
const QString deviceProfilePrefix = QLatin1String("DeviceProfile");
|
||||
const QChar dot = QLatin1Char('.');
|
||||
|
||||
foreach(QAction* a, actions) {
|
||||
foreach (QAction* a, actions) {
|
||||
QString name = menuId;
|
||||
name += dot;
|
||||
const QVariant data = a->data();
|
||||
|
||||
@@ -101,7 +101,7 @@ QString BaseTextFind::currentFindString() const
|
||||
cursor.movePosition(QTextCursor::StartOfWord);
|
||||
cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
|
||||
QString s = cursor.selectedText();
|
||||
foreach(QChar c, s) {
|
||||
foreach (QChar c, s) {
|
||||
if (!c.isLetterOrNumber() && c != QLatin1Char('_')) {
|
||||
s.clear();
|
||||
break;
|
||||
|
||||
@@ -161,7 +161,7 @@ GitPlugin::~GitPlugin()
|
||||
}
|
||||
|
||||
if (!m_editorFactories.empty()) {
|
||||
foreach(Core::IEditorFactory* pf, m_editorFactories)
|
||||
foreach (Core::IEditorFactory* pf, m_editorFactories)
|
||||
removeObject(pf);
|
||||
qDeleteAll(m_editorFactories);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ void ContentsToolWindow::contentsDone()
|
||||
{
|
||||
m_widget->setCursor(QCursor(Qt::WaitCursor));
|
||||
QList<QPair<QString, ContentList> > contentList = helpEngine->contents();
|
||||
for(QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) {
|
||||
for (QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) {
|
||||
QTreeWidgetItem *newEntry;
|
||||
QTreeWidgetItem *contentEntry;
|
||||
QStack<QTreeWidgetItem*> stack;
|
||||
@@ -135,7 +135,7 @@ void ContentsToolWindow::contentsDone()
|
||||
bool root = false;
|
||||
|
||||
QTreeWidgetItem *lastItem[64];
|
||||
for(int j = 0; j < 64; ++j)
|
||||
for (int j = 0; j < 64; ++j)
|
||||
lastItem[j] = 0;
|
||||
|
||||
ContentList lst = (*it).second;
|
||||
@@ -149,19 +149,18 @@ void ContentsToolWindow::contentsDone()
|
||||
stack.push(newEntry);
|
||||
depth = 1;
|
||||
root = true;
|
||||
}
|
||||
else{
|
||||
if((item.depth > depth) && root) {
|
||||
} else {
|
||||
if (item.depth > depth && root) {
|
||||
depth = item.depth;
|
||||
stack.push(contentEntry);
|
||||
}
|
||||
if(item.depth == depth) {
|
||||
if (item.depth == depth) {
|
||||
contentEntry = new QTreeWidgetItem(stack.top(), lastItem[ depth ]);
|
||||
lastItem[ depth ] = contentEntry;
|
||||
contentEntry->setText(0, item.title);
|
||||
contentEntry->setData(0, LinkRole, item.reference);
|
||||
}
|
||||
else if(item.depth < depth) {
|
||||
else if (item.depth < depth) {
|
||||
stack.pop();
|
||||
depth--;
|
||||
item = *(--it);
|
||||
|
||||
@@ -296,7 +296,7 @@ quint32 HelpEngine::getFileAges()
|
||||
QStringList::const_iterator i = addDocuFiles.begin();
|
||||
|
||||
quint32 fileAges = 0;
|
||||
for(; i != addDocuFiles.end(); ++i) {
|
||||
for (; i != addDocuFiles.end(); ++i) {
|
||||
QFileInfo fi(*i);
|
||||
if (fi.exists())
|
||||
fileAges += fi.lastModified().toTime_t();
|
||||
@@ -364,7 +364,7 @@ void TitleMapThread::run()
|
||||
bool needRebuild = false;
|
||||
if (Config::configuration()->profileName() == QLatin1String("default")) {
|
||||
const QStringList docuFiles = Config::configuration()->docFiles();
|
||||
for(QStringList::ConstIterator it = docuFiles.begin(); it != docuFiles.end(); it++) {
|
||||
for (QStringList::ConstIterator it = docuFiles.begin(); it != docuFiles.end(); it++) {
|
||||
if (!QFile::exists(*it)) {
|
||||
Config::configuration()->saveProfile(Profile::createDefaultProfile());
|
||||
Config::configuration()->loadDefaultProfile();
|
||||
@@ -383,7 +383,7 @@ void TitleMapThread::run()
|
||||
getAllContents();
|
||||
|
||||
titleMap.clear();
|
||||
for(QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) {
|
||||
for (QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) {
|
||||
ContentList lst = (*it).second;
|
||||
foreach (ContentItem item, lst) {
|
||||
titleMap[item.reference] = item.title.trimmed();
|
||||
@@ -430,7 +430,7 @@ void TitleMapThread::buildContentDict()
|
||||
QStringList docuFiles = Config::configuration()->docFiles();
|
||||
|
||||
quint32 fileAges = 0;
|
||||
for(QStringList::iterator it = docuFiles.begin(); it != docuFiles.end(); it++) {
|
||||
for (QStringList::iterator it = docuFiles.begin(); it != docuFiles.end(); it++) {
|
||||
QFile file(*it);
|
||||
if (!file.exists()) {
|
||||
#ifdef _SHOW_ERRORS_
|
||||
@@ -441,7 +441,7 @@ void TitleMapThread::buildContentDict()
|
||||
}
|
||||
fileAges += QFileInfo(file).lastModified().toTime_t();
|
||||
DocuParser *handler = DocuParser::createParser(*it);
|
||||
if(!handler) {
|
||||
if (!handler) {
|
||||
#ifdef _SHOW_ERRORS_
|
||||
emit errorOccured(tr("Documentation file %1 is not compatible!\n"
|
||||
"Skipping file.").arg(QFileInfo(file).absoluteFilePath()));
|
||||
@@ -450,7 +450,7 @@ void TitleMapThread::buildContentDict()
|
||||
}
|
||||
bool ok = handler->parse(&file);
|
||||
file.close();
|
||||
if(ok) {
|
||||
if (ok) {
|
||||
contentList += qMakePair(*it, QList<ContentItem>(handler->getContentItems()));
|
||||
delete handler;
|
||||
} else {
|
||||
@@ -469,7 +469,7 @@ void TitleMapThread::buildContentDict()
|
||||
if (contentOut.open(QFile::WriteOnly)) {
|
||||
QDataStream s(&contentOut);
|
||||
s << fileAges;
|
||||
for(QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) {
|
||||
for (QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) {
|
||||
s << *it;
|
||||
}
|
||||
contentOut.close();
|
||||
@@ -542,12 +542,12 @@ void IndexThread::buildKeywordDB()
|
||||
QStringList::iterator i = addDocuFiles.begin();
|
||||
|
||||
int steps = 0;
|
||||
for(; i != addDocuFiles.end(); i++)
|
||||
for (; i != addDocuFiles.end(); i++)
|
||||
steps += QFileInfo(*i).size();
|
||||
|
||||
QList<IndexKeyword> lst;
|
||||
quint32 fileAges = 0;
|
||||
for(i = addDocuFiles.begin(); i != addDocuFiles.end(); i++){
|
||||
for (i = addDocuFiles.begin(); i != addDocuFiles.end(); i++) {
|
||||
QFile file(*i);
|
||||
if (!file.exists()) {
|
||||
#ifdef _SHOW_ERRORS_
|
||||
@@ -560,7 +560,7 @@ void IndexThread::buildKeywordDB()
|
||||
DocuParser *handler = DocuParser::createParser(*i);
|
||||
bool ok = handler->parse(&file);
|
||||
file.close();
|
||||
if(!ok){
|
||||
if (!ok){
|
||||
#ifdef _SHOW_ERRORS_
|
||||
QString msg = QString::fromLatin1("In file %1:\n%2")
|
||||
.arg(QFileInfo(file).absoluteFilePath())
|
||||
|
||||
@@ -512,7 +512,7 @@ void HelpPlugin::activateContext()
|
||||
// case 1 sidebar shown and has focus, we show whatever we have in the
|
||||
// sidebar in big
|
||||
RightPanePlaceHolder* placeHolder = RightPanePlaceHolder::current();
|
||||
if(placeHolder && Core::RightPaneWidget::instance()->hasFocus()) {
|
||||
if (placeHolder && Core::RightPaneWidget::instance()->hasFocus()) {
|
||||
switchToHelpMode();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -561,10 +561,9 @@ void PerforcePlugin::submit()
|
||||
|
||||
QStringList stdOutLines = result2.stdOut.split(QLatin1Char('\n'));
|
||||
QStringList depotFileNames;
|
||||
foreach(const QString &line, stdOutLines) {
|
||||
if (line.startsWith("... depotFile")) {
|
||||
foreach (const QString &line, stdOutLines) {
|
||||
if (line.startsWith("... depotFile"))
|
||||
depotFileNames.append(line.mid(14));
|
||||
}
|
||||
}
|
||||
if (depotFileNames.isEmpty()) {
|
||||
showOutput(tr("Project has no files"));
|
||||
@@ -1225,7 +1224,7 @@ PerforcePlugin::~PerforcePlugin()
|
||||
}
|
||||
|
||||
if (!m_editorFactories.empty()) {
|
||||
foreach(Core::IEditorFactory* pf, m_editorFactories)
|
||||
foreach (Core::IEditorFactory *pf, m_editorFactories)
|
||||
removeObject(pf);
|
||||
qDeleteAll(m_editorFactories);
|
||||
m_editorFactories.clear();
|
||||
|
||||
@@ -112,7 +112,7 @@ bool AbstractProcessStep::init(const QString &name)
|
||||
void AbstractProcessStep::run(QFutureInterface<bool> & fi)
|
||||
{
|
||||
m_futureInterface = &fi;
|
||||
if(!m_enabled) {
|
||||
if (!m_enabled) {
|
||||
fi.reportResult(true);
|
||||
return;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> & fi)
|
||||
Qt::DirectConnection);
|
||||
|
||||
m_process->start(m_command, m_arguments);
|
||||
if(!m_process->waitForStarted()) {
|
||||
if (!m_process->waitForStarted()) {
|
||||
processStartupFailed();
|
||||
delete m_process;
|
||||
m_process = 0;
|
||||
@@ -188,8 +188,7 @@ void AbstractProcessStep::processStartupFailed()
|
||||
void AbstractProcessStep::processReadyReadStdOutput()
|
||||
{
|
||||
m_process->setReadChannel(QProcess::StandardOutput);
|
||||
while(m_process->canReadLine())
|
||||
{
|
||||
while (m_process->canReadLine()) {
|
||||
QString line = QString::fromLocal8Bit(m_process->readLine()).trimmed();
|
||||
stdOut(line);
|
||||
}
|
||||
@@ -203,8 +202,7 @@ void AbstractProcessStep::stdOut(const QString &line)
|
||||
void AbstractProcessStep::processReadyReadStdError()
|
||||
{
|
||||
m_process->setReadChannel(QProcess::StandardError);
|
||||
while (m_process->canReadLine())
|
||||
{
|
||||
while (m_process->canReadLine()) {
|
||||
QString line = QString::fromLocal8Bit(m_process->readLine()).trimmed();
|
||||
stdError(line);
|
||||
}
|
||||
@@ -217,7 +215,7 @@ void AbstractProcessStep::stdError(const QString &line)
|
||||
|
||||
void AbstractProcessStep::checkForCancel()
|
||||
{
|
||||
if(m_futureInterface->isCanceled() && m_timer->isActive()) {
|
||||
if (m_futureInterface->isCanceled() && m_timer->isActive()) {
|
||||
m_timer->stop();
|
||||
m_process->terminate();
|
||||
m_process->waitForFinished(5000);
|
||||
@@ -228,13 +226,12 @@ void AbstractProcessStep::checkForCancel()
|
||||
void AbstractProcessStep::slotProcessFinished(int, QProcess::ExitStatus)
|
||||
{
|
||||
QString line = QString::fromLocal8Bit(m_process->readAllStandardError()).trimmed();
|
||||
if (!line.isEmpty()) {
|
||||
if (!line.isEmpty())
|
||||
stdOut(line);
|
||||
}
|
||||
|
||||
line = QString::fromLocal8Bit(m_process->readAllStandardOutput()).trimmed();
|
||||
if (!line.isEmpty()) {
|
||||
if (!line.isEmpty())
|
||||
stdError(line);
|
||||
}
|
||||
|
||||
m_eventLoop->exit(0);
|
||||
}
|
||||
|
||||
@@ -42,9 +42,8 @@ BuildConfiguration::BuildConfiguration(const QString &name)
|
||||
}
|
||||
|
||||
BuildConfiguration::BuildConfiguration(const QString &name, BuildConfiguration *source)
|
||||
:m_values(source->m_values), m_name(name)
|
||||
: m_values(source->m_values), m_name(name)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QString BuildConfiguration::name() const
|
||||
@@ -71,7 +70,7 @@ void BuildConfiguration::setDisplayName(const QString &name)
|
||||
QVariant BuildConfiguration::getValue(const QString & key) const
|
||||
{
|
||||
QHash<QString, QVariant>::const_iterator it = m_values.find(key);
|
||||
if(it != m_values.constEnd())
|
||||
if (it != m_values.constEnd())
|
||||
return *it;
|
||||
else
|
||||
return QVariant();
|
||||
@@ -86,7 +85,7 @@ void BuildConfiguration::setValuesFromMap(QMap<QString, QVariant> map)
|
||||
{
|
||||
QMap<QString, QVariant>::const_iterator it, end;
|
||||
end = map.constEnd();
|
||||
for(it = map.constBegin(); it != end; ++it)
|
||||
for (it = map.constBegin(); it != end; ++it)
|
||||
setValue(it.key(), it.value());
|
||||
}
|
||||
|
||||
@@ -95,7 +94,7 @@ QMap<QString, QVariant> BuildConfiguration::toMap() const
|
||||
QMap<QString, QVariant> result;
|
||||
QHash<QString, QVariant>::const_iterator it, end;
|
||||
end = m_values.constEnd();
|
||||
for(it = m_values.constBegin(); it != end; ++it)
|
||||
for (it = m_values.constBegin(); it != end; ++it)
|
||||
result.insert(it.key(), it.value());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ BuildSettingsWidget::BuildSettingsWidget(Project *project)
|
||||
void BuildSettingsWidget::buildConfigurationDisplayNameChanged(const QString &buildConfiguration)
|
||||
{
|
||||
QTreeWidgetItem *rootItem = m_ui.buildSettingsList->invisibleRootItem();
|
||||
for(int i = 0; i < rootItem->childCount(); ++i) {
|
||||
for (int i = 0; i < rootItem->childCount(); ++i) {
|
||||
QTreeWidgetItem *child = rootItem->child(i);
|
||||
if (child->data(0, Qt::UserRole).toString() == buildConfiguration) {
|
||||
child->setText(0, m_project->displayNameFor(buildConfiguration));
|
||||
@@ -334,7 +334,7 @@ void BuildSettingsWidget::createConfiguration()
|
||||
{
|
||||
bool ok;
|
||||
QString newBuildConfiguration = QInputDialog::getText(this, tr("New configuration"), tr("New Configuration Name:"), QLineEdit::Normal, QString(), &ok);
|
||||
if(!ok || newBuildConfiguration.isEmpty())
|
||||
if (!ok || newBuildConfiguration.isEmpty())
|
||||
return;
|
||||
|
||||
QString newDisplayName = newBuildConfiguration;
|
||||
@@ -342,22 +342,20 @@ void BuildSettingsWidget::createConfiguration()
|
||||
const QStringList &buildConfigurations = m_project->buildConfigurations();
|
||||
if (buildConfigurations.contains(newBuildConfiguration)) {
|
||||
int i = 2;
|
||||
while(buildConfigurations.contains(newBuildConfiguration + QString::number(i))) {
|
||||
while (buildConfigurations.contains(newBuildConfiguration + QString::number(i)))
|
||||
++i;
|
||||
}
|
||||
newBuildConfiguration += QString::number(i);
|
||||
}
|
||||
|
||||
// Check that we don't have a configuration with the same displayName
|
||||
QStringList displayNames;
|
||||
foreach(const QString &bc, buildConfigurations)
|
||||
foreach (const QString &bc, buildConfigurations)
|
||||
displayNames << m_project->displayNameFor(bc);
|
||||
|
||||
if (displayNames.contains(newDisplayName)) {
|
||||
int i = 2;
|
||||
while(displayNames.contains(newDisplayName + QString::number(i))) {
|
||||
while (displayNames.contains(newDisplayName + QString::number(i)))
|
||||
++i;
|
||||
}
|
||||
newDisplayName += QString::number(i);
|
||||
}
|
||||
|
||||
@@ -407,11 +405,11 @@ void BuildSettingsWidget::setActiveConfiguration(const QString &configuration)
|
||||
|
||||
void BuildSettingsWidget::cloneConfiguration(const QString &sourceConfiguration)
|
||||
{
|
||||
if(sourceConfiguration.isEmpty())
|
||||
if (sourceConfiguration.isEmpty())
|
||||
return;
|
||||
|
||||
QString newBuildConfiguration = QInputDialog::getText(this, tr("Clone configuration"), tr("New Configuration Name:"));
|
||||
if(newBuildConfiguration.isEmpty())
|
||||
if (newBuildConfiguration.isEmpty())
|
||||
return;
|
||||
|
||||
QString newDisplayName = newBuildConfiguration;
|
||||
@@ -419,22 +417,20 @@ void BuildSettingsWidget::cloneConfiguration(const QString &sourceConfiguration)
|
||||
const QStringList &buildConfigurations = m_project->buildConfigurations();
|
||||
if (buildConfigurations.contains(newBuildConfiguration)) {
|
||||
int i = 2;
|
||||
while(buildConfigurations.contains(newBuildConfiguration + QString::number(i))) {
|
||||
while (buildConfigurations.contains(newBuildConfiguration + QString::number(i)))
|
||||
++i;
|
||||
}
|
||||
newBuildConfiguration += QString::number(i);
|
||||
}
|
||||
|
||||
// Check that we don't have a configuration with the same displayName
|
||||
QStringList displayNames;
|
||||
foreach(const QString &bc, buildConfigurations)
|
||||
foreach (const QString &bc, buildConfigurations)
|
||||
displayNames << m_project->displayNameFor(bc);
|
||||
|
||||
if (displayNames.contains(newDisplayName)) {
|
||||
int i = 2;
|
||||
while(displayNames.contains(newDisplayName + QString::number(i))) {
|
||||
while (displayNames.contains(newDisplayName + QString::number(i)))
|
||||
++i;
|
||||
}
|
||||
newDisplayName += QString::number(i);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,8 +60,8 @@ void BuildStep::addBuildConfiguration(const QString &name)
|
||||
|
||||
void BuildStep::removeBuildConfiguration(const QString &name)
|
||||
{
|
||||
for(int i = 0; i != m_buildConfigurations.size(); ++i)
|
||||
if(m_buildConfigurations.at(i)->name() == name) {
|
||||
for (int i = 0; i != m_buildConfigurations.size(); ++i)
|
||||
if (m_buildConfigurations.at(i)->name() == name) {
|
||||
delete m_buildConfigurations.at(i);
|
||||
m_buildConfigurations.removeAt(i);
|
||||
break;
|
||||
@@ -70,8 +70,8 @@ void BuildStep::removeBuildConfiguration(const QString &name)
|
||||
|
||||
void BuildStep::copyBuildConfiguration(const QString &source, const QString &dest)
|
||||
{
|
||||
for(int i = 0; i != m_buildConfigurations.size(); ++i)
|
||||
if(m_buildConfigurations.at(i)->name() == source)
|
||||
for (int i = 0; i != m_buildConfigurations.size(); ++i)
|
||||
if (m_buildConfigurations.at(i)->name() == source)
|
||||
m_buildConfigurations.push_back(new BuildConfiguration(dest, m_buildConfigurations.at(i)));
|
||||
}
|
||||
|
||||
|
||||
@@ -119,17 +119,17 @@ void BuildStepsPage::init(const QString &buildConfiguration)
|
||||
/* switch from one tree item / build step to another */
|
||||
void BuildStepsPage::updateBuildStepWidget(QTreeWidgetItem *newItem, QTreeWidgetItem *oldItem)
|
||||
{
|
||||
if(oldItem == newItem)
|
||||
if (oldItem == newItem)
|
||||
return;
|
||||
Q_ASSERT(m_pro);
|
||||
|
||||
if(newItem) {
|
||||
if (newItem) {
|
||||
int row = m_ui->buildSettingsList->indexOfTopLevelItem(newItem);
|
||||
m_ui->buildSettingsWidget->setCurrentIndex(row);
|
||||
BuildStepConfigWidget *widget = qobject_cast<BuildStepConfigWidget *>(m_ui->buildSettingsWidget->currentWidget());
|
||||
Q_ASSERT(widget);
|
||||
if (widget)
|
||||
widget->init(m_configuration);
|
||||
widget->init(m_configuration);
|
||||
}
|
||||
updateBuildStepButtonsState();
|
||||
}
|
||||
@@ -151,11 +151,11 @@ void BuildStepsPage::updateAddBuildStepMenu()
|
||||
QMenu *menu = m_ui->buildStepAddButton->menu();
|
||||
m_addBuildStepHash.clear();
|
||||
menu->clear();
|
||||
if(!map.isEmpty()) {
|
||||
if (!map.isEmpty()) {
|
||||
QStringList names;
|
||||
QMap<QString, QPair<QString, IBuildStepFactory *> >::const_iterator it, end;
|
||||
end = map.constEnd();
|
||||
for(it = map.constBegin(); it != end; ++it) {
|
||||
for (it = map.constBegin(); it != end; ++it) {
|
||||
QAction *action = menu->addAction(it.key());
|
||||
connect(action, SIGNAL(triggered()),
|
||||
this, SLOT(addBuildStep()));
|
||||
@@ -167,7 +167,7 @@ void BuildStepsPage::updateAddBuildStepMenu()
|
||||
|
||||
void BuildStepsPage::addBuildStep()
|
||||
{
|
||||
if(QAction *action = qobject_cast<QAction *>(sender())) {
|
||||
if (QAction *action = qobject_cast<QAction *>(sender())) {
|
||||
QPair<QString, IBuildStepFactory *> pair = m_addBuildStepHash.value(action);
|
||||
BuildStep *newStep = pair.second->create(m_pro, pair.first);
|
||||
m_pro->insertBuildStep(0, newStep);
|
||||
@@ -182,7 +182,7 @@ void BuildStepsPage::addBuildStep()
|
||||
void BuildStepsPage::removeBuildStep()
|
||||
{
|
||||
int pos = m_ui->buildSettingsList->currentIndex().row();
|
||||
if(m_pro->buildSteps().at(pos)->immutable())
|
||||
if (m_pro->buildSteps().at(pos)->immutable())
|
||||
return;
|
||||
bool blockSignals = m_ui->buildSettingsList->blockSignals(true);
|
||||
delete m_ui->buildSettingsList->invisibleRootItem()->takeChild(pos);
|
||||
@@ -190,7 +190,7 @@ void BuildStepsPage::removeBuildStep()
|
||||
QWidget *widget = m_ui->buildSettingsWidget->widget(pos);
|
||||
m_ui->buildSettingsWidget->removeWidget(widget);
|
||||
delete widget;
|
||||
if(pos < m_ui->buildSettingsList->invisibleRootItem()->childCount())
|
||||
if (pos < m_ui->buildSettingsList->invisibleRootItem()->childCount())
|
||||
m_ui->buildSettingsList->setCurrentItem(m_ui->buildSettingsList->invisibleRootItem()->child(pos));
|
||||
else
|
||||
m_ui->buildSettingsList->setCurrentItem(m_ui->buildSettingsList->invisibleRootItem()->child(pos - 1));
|
||||
@@ -201,11 +201,11 @@ void BuildStepsPage::removeBuildStep()
|
||||
void BuildStepsPage::upBuildStep()
|
||||
{
|
||||
int pos = m_ui->buildSettingsList->currentIndex().row();
|
||||
if(pos < 1)
|
||||
if (pos < 1)
|
||||
return;
|
||||
if(pos > m_ui->buildSettingsList->invisibleRootItem()->childCount()-1)
|
||||
if (pos > m_ui->buildSettingsList->invisibleRootItem()->childCount()-1)
|
||||
return;
|
||||
if(m_pro->buildSteps().at(pos)->immutable() && m_pro->buildSteps().at(pos-1)->immutable())
|
||||
if (m_pro->buildSteps().at(pos)->immutable() && m_pro->buildSteps().at(pos-1)->immutable())
|
||||
return;
|
||||
|
||||
bool blockSignals = m_ui->buildSettingsList->blockSignals(true);
|
||||
@@ -220,11 +220,11 @@ void BuildStepsPage::upBuildStep()
|
||||
void BuildStepsPage::downBuildStep()
|
||||
{
|
||||
int pos = m_ui->buildSettingsList->currentIndex().row() + 1;
|
||||
if(pos < 1)
|
||||
if (pos < 1)
|
||||
return;
|
||||
if(pos > m_ui->buildSettingsList->invisibleRootItem()->childCount() - 1)
|
||||
if (pos > m_ui->buildSettingsList->invisibleRootItem()->childCount() - 1)
|
||||
return;
|
||||
if(m_pro->buildSteps().at(pos)->immutable() && m_pro->buildSteps().at(pos - 1)->immutable())
|
||||
if (m_pro->buildSteps().at(pos)->immutable() && m_pro->buildSteps().at(pos - 1)->immutable())
|
||||
return;
|
||||
|
||||
bool blockSignals = m_ui->buildSettingsList->blockSignals(true);
|
||||
@@ -238,7 +238,7 @@ void BuildStepsPage::downBuildStep()
|
||||
|
||||
void BuildStepsPage::changeEvent(QEvent *e)
|
||||
{
|
||||
switch(e->type()) {
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
m_ui->retranslateUi(this);
|
||||
break;
|
||||
|
||||
@@ -45,7 +45,7 @@ QList<EnvironmentItem> EnvironmentItem::fromStringList(QStringList list)
|
||||
QList<EnvironmentItem> result;
|
||||
foreach (const QString &string, list) {
|
||||
int pos = string.indexOf(QLatin1Char('='));
|
||||
if(pos == -1) {
|
||||
if (pos == -1) {
|
||||
EnvironmentItem item(string, "");
|
||||
item.unset = true;
|
||||
result.append(item);
|
||||
@@ -61,7 +61,7 @@ QStringList EnvironmentItem::toStringList(QList<EnvironmentItem> list)
|
||||
{
|
||||
QStringList result;
|
||||
foreach (const EnvironmentItem &item, list) {
|
||||
if(item.unset)
|
||||
if (item.unset)
|
||||
result << QString(item.name);
|
||||
else
|
||||
result << QString(item.name + '=' + item.value);
|
||||
@@ -71,14 +71,13 @@ QStringList EnvironmentItem::toStringList(QList<EnvironmentItem> list)
|
||||
|
||||
Environment::Environment()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Environment::Environment(QStringList env)
|
||||
{
|
||||
foreach(QString s, env) {
|
||||
foreach (const QString &s, env) {
|
||||
int i = s.indexOf("=");
|
||||
if (i >=0 ) {
|
||||
if (i >= 0) {
|
||||
#ifdef Q_OS_WIN
|
||||
m_values.insert(s.left(i).toUpper(), s.mid(i+1));
|
||||
#else
|
||||
@@ -196,13 +195,13 @@ QString Environment::searchInPath(QString executable)
|
||||
executable.append(QLatin1String(".exe"));
|
||||
#endif
|
||||
const QChar slash = QLatin1Char('/');
|
||||
foreach(const QString &p, path()) {
|
||||
foreach (const QString &p, path()) {
|
||||
// qDebug()<<"trying"<<path + '/' + executable;
|
||||
QString fp = p;
|
||||
fp += slash;
|
||||
fp += executable;
|
||||
const QFileInfo fi(fp);
|
||||
if(fi.exists()) {
|
||||
if (fi.exists()) {
|
||||
// qDebug()<<"returning "<<fi.absoluteFilePath();
|
||||
return fi.absoluteFilePath();
|
||||
}
|
||||
@@ -248,7 +247,7 @@ Environment::const_iterator Environment::constEnd() const
|
||||
Environment::const_iterator Environment::find(const QString &name)
|
||||
{
|
||||
QMap<QString, QString>::const_iterator it = m_values.constFind(name);
|
||||
if(it == m_values.constEnd())
|
||||
if (it == m_values.constEnd())
|
||||
return constEnd();
|
||||
else
|
||||
return it;
|
||||
@@ -263,24 +262,24 @@ void Environment::modify(const QList<EnvironmentItem> & list)
|
||||
{
|
||||
Environment resultEnvironment = *this;
|
||||
foreach (const EnvironmentItem &item, list) {
|
||||
if(item.unset) {
|
||||
if (item.unset) {
|
||||
resultEnvironment.unset(item.name);
|
||||
} else {
|
||||
// TODO use variable expansion
|
||||
QString value = item.value;
|
||||
for(int i=0; i < value.size(); ++i) {
|
||||
if(value.at(i) == QLatin1Char('$')) {
|
||||
if((i + 1) < value.size()) {
|
||||
for (int i=0; i < value.size(); ++i) {
|
||||
if (value.at(i) == QLatin1Char('$')) {
|
||||
if ((i + 1) < value.size()) {
|
||||
const QChar &c = value.at(i+1);
|
||||
int end = -1;
|
||||
if (c == '(')
|
||||
end = value.indexOf(')', i);
|
||||
else if (c=='{')
|
||||
else if (c == '{')
|
||||
end = value.indexOf('}', i);
|
||||
if(end != -1) {
|
||||
if (end != -1) {
|
||||
const QString &name = value.mid(i+2, end-i-2);
|
||||
Environment::const_iterator it = find(name);
|
||||
if(it != constEnd())
|
||||
if (it != constEnd())
|
||||
value.replace(i, end-i+1, it.value());
|
||||
}
|
||||
}
|
||||
@@ -334,7 +333,7 @@ QStringList Environment::parseCombinedArgString(const QString &program)
|
||||
QString Environment::joinArgumentList(const QStringList &arguments)
|
||||
{
|
||||
QString result;
|
||||
foreach(QString arg, arguments) {
|
||||
foreach (QString arg, arguments) {
|
||||
if (!result.isEmpty())
|
||||
result += QLatin1Char(' ');
|
||||
arg.replace(QLatin1String("\""), QLatin1String("\"\"\""));
|
||||
|
||||
@@ -38,11 +38,13 @@ using namespace ProjectExplorer;
|
||||
EnvironmentModel::EnvironmentModel()
|
||||
: m_mergedEnvironments(false)
|
||||
{}
|
||||
EnvironmentModel::~EnvironmentModel() {}
|
||||
|
||||
EnvironmentModel::~EnvironmentModel()
|
||||
{}
|
||||
|
||||
QString EnvironmentModel::indexToVariable(const QModelIndex &index) const
|
||||
{
|
||||
if(m_mergedEnvironments)
|
||||
if (m_mergedEnvironments)
|
||||
return m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row());
|
||||
else
|
||||
return m_items.at(index.row()).name;
|
||||
@@ -53,7 +55,7 @@ void EnvironmentModel::updateResultEnvironment()
|
||||
m_resultEnvironment = m_baseEnvironment;
|
||||
m_resultEnvironment.modify(m_items);
|
||||
foreach (const EnvironmentItem &item, m_items) {
|
||||
if(item.unset) {
|
||||
if (item.unset) {
|
||||
m_resultEnvironment.set(item.name, "<UNSET>");
|
||||
}
|
||||
}
|
||||
@@ -68,10 +70,10 @@ void EnvironmentModel::setBaseEnvironment(const ProjectExplorer::Environment &en
|
||||
|
||||
void EnvironmentModel::setMergedEnvironments(bool b)
|
||||
{
|
||||
if(m_mergedEnvironments == b)
|
||||
if (m_mergedEnvironments == b)
|
||||
return;
|
||||
m_mergedEnvironments = b;
|
||||
if(b)
|
||||
if (b)
|
||||
updateResultEnvironment();
|
||||
reset();
|
||||
}
|
||||
@@ -96,48 +98,46 @@ int EnvironmentModel::columnCount(const QModelIndex &parent) const
|
||||
|
||||
bool EnvironmentModel::changes(const QString &name) const
|
||||
{
|
||||
foreach(const EnvironmentItem& item, m_items) {
|
||||
if(item.name == name) {
|
||||
foreach (const EnvironmentItem& item, m_items)
|
||||
if (item.name == name)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QVariant EnvironmentModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if((role == Qt::DisplayRole || role == Qt::EditRole) && index.isValid()) {
|
||||
if((m_mergedEnvironments && index.row() >= m_resultEnvironment.size()) ||
|
||||
if ((role == Qt::DisplayRole || role == Qt::EditRole) && index.isValid()) {
|
||||
if ((m_mergedEnvironments && index.row() >= m_resultEnvironment.size()) ||
|
||||
(!m_mergedEnvironments && index.row() >= m_items.count())) {
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
if(index.column() == 0) {
|
||||
if(m_mergedEnvironments) {
|
||||
if (index.column() == 0) {
|
||||
if (m_mergedEnvironments) {
|
||||
return m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row());
|
||||
} else {
|
||||
return m_items.at(index.row()).name;
|
||||
}
|
||||
} else if(index.column() == 1) {
|
||||
if(m_mergedEnvironments) {
|
||||
if(role == Qt::EditRole) {
|
||||
} else if (index.column() == 1) {
|
||||
if (m_mergedEnvironments) {
|
||||
if (role == Qt::EditRole) {
|
||||
int pos = findInChanges(indexToVariable(index));
|
||||
if(pos != -1)
|
||||
if (pos != -1)
|
||||
return m_items.at(pos).value;
|
||||
}
|
||||
return m_resultEnvironment.value(m_resultEnvironment.constBegin() + index.row());
|
||||
} else {
|
||||
if(m_items.at(index.row()).unset)
|
||||
if (m_items.at(index.row()).unset)
|
||||
return "<UNSET>";
|
||||
else
|
||||
return m_items.at(index.row()).value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(role == Qt::FontRole) {
|
||||
if(m_mergedEnvironments) {
|
||||
if (role == Qt::FontRole) {
|
||||
if (m_mergedEnvironments) {
|
||||
// check wheter this environment variable exists in m_items
|
||||
if(changes(m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row()))) {
|
||||
if (changes(m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row()))) {
|
||||
QFont f;
|
||||
f.setBold(true);
|
||||
return QVariant(f);
|
||||
@@ -157,7 +157,7 @@ Qt::ItemFlags EnvironmentModel::flags(const QModelIndex &index) const
|
||||
|
||||
bool EnvironmentModel::hasChildren(const QModelIndex &index) const
|
||||
{
|
||||
if(!index.isValid())
|
||||
if (!index.isValid())
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
@@ -165,14 +165,14 @@ bool EnvironmentModel::hasChildren(const QModelIndex &index) const
|
||||
|
||||
QVariant EnvironmentModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
if(orientation == Qt::Vertical || role != Qt::DisplayRole)
|
||||
if (orientation == Qt::Vertical || role != Qt::DisplayRole)
|
||||
return QVariant();
|
||||
return section == 0 ? tr("Variable") : tr("Value");
|
||||
}
|
||||
|
||||
QModelIndex EnvironmentModel::index(int row, int column, const QModelIndex &parent) const
|
||||
{
|
||||
if(!parent.isValid())
|
||||
if (!parent.isValid())
|
||||
return createIndex(row, column, 0);
|
||||
return QModelIndex();
|
||||
}
|
||||
@@ -188,16 +188,16 @@ QModelIndex EnvironmentModel::parent(const QModelIndex &index) const
|
||||
/// *****************
|
||||
int EnvironmentModel::findInChanges(const QString &name) const
|
||||
{
|
||||
for(int i=0; i<m_items.size(); ++i)
|
||||
if(m_items.at(i).name == name)
|
||||
for (int i=0; i<m_items.size(); ++i)
|
||||
if (m_items.at(i).name == name)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int EnvironmentModel::findInChangesInsertPosition(const QString &name) const
|
||||
{
|
||||
for(int i=0; i<m_items.size(); ++i)
|
||||
if(m_items.at(i).name > name)
|
||||
for (int i=0; i<m_items.size(); ++i)
|
||||
if (m_items.at(i).name > name)
|
||||
return i;
|
||||
return m_items.size();
|
||||
}
|
||||
@@ -206,8 +206,8 @@ int EnvironmentModel::findInResult(const QString &name) const
|
||||
{
|
||||
Environment::const_iterator it;
|
||||
int i = 0;
|
||||
for(it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i)
|
||||
if(m_resultEnvironment.key(it) == name)
|
||||
for (it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i)
|
||||
if (m_resultEnvironment.key(it) == name)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
@@ -216,28 +216,28 @@ int EnvironmentModel::findInResultInsertPosition(const QString &name) const
|
||||
{
|
||||
Environment::const_iterator it;
|
||||
int i = 0;
|
||||
for(it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i)
|
||||
if(m_resultEnvironment.key(it) > name)
|
||||
for (it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i)
|
||||
if (m_resultEnvironment.key(it) > name)
|
||||
return i;
|
||||
return m_resultEnvironment.size();
|
||||
}
|
||||
|
||||
bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||
{
|
||||
if(role == Qt::EditRole && index.isValid()) {
|
||||
if(index.column() == 0) {
|
||||
if (role == Qt::EditRole && index.isValid()) {
|
||||
if (index.column() == 0) {
|
||||
//fail if a variable with the same name already exists
|
||||
#ifdef Q_OS_WIN
|
||||
if(findInChanges(value.toString().toUpper()) != -1)
|
||||
if (findInChanges(value.toString().toUpper()) != -1)
|
||||
return false;
|
||||
#else
|
||||
if(findInChanges(value.toString()) != -1)
|
||||
if (findInChanges(value.toString()) != -1)
|
||||
return false;
|
||||
#endif
|
||||
EnvironmentItem old("", "");
|
||||
if(m_mergedEnvironments) {
|
||||
if (m_mergedEnvironments) {
|
||||
int pos = findInChanges(indexToVariable(index));
|
||||
if(pos != -1) {
|
||||
if (pos != -1) {
|
||||
old = m_items.at(pos);
|
||||
} else {
|
||||
old.name = m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row());
|
||||
@@ -252,16 +252,16 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
|
||||
#else
|
||||
const QString &newName = value.toString();
|
||||
#endif
|
||||
if(changes(old.name))
|
||||
if (changes(old.name))
|
||||
removeVariable(old.name);
|
||||
old.name = newName;
|
||||
addVariable(old);
|
||||
return true;
|
||||
} else if(index.column() == 1) {
|
||||
if(m_mergedEnvironments) {
|
||||
} else if (index.column() == 1) {
|
||||
if (m_mergedEnvironments) {
|
||||
const QString &name = indexToVariable(index);
|
||||
int pos = findInChanges(name);
|
||||
if(pos != -1) {
|
||||
if (pos != -1) {
|
||||
m_items[pos].value = value.toString();
|
||||
m_items[pos].unset = false;
|
||||
updateResultEnvironment();
|
||||
@@ -287,13 +287,13 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
|
||||
QModelIndex EnvironmentModel::addVariable()
|
||||
{
|
||||
const QString &name = "<VARIABLE>";
|
||||
if(m_mergedEnvironments) {
|
||||
if (m_mergedEnvironments) {
|
||||
int i = findInResult(name);
|
||||
if(i != -1)
|
||||
if (i != -1)
|
||||
return index(i, 0, QModelIndex());
|
||||
} else {
|
||||
int i = findInChanges(name);
|
||||
if(i != -1)
|
||||
if (i != -1)
|
||||
return index(i, 0, QModelIndex());
|
||||
}
|
||||
// Don't exist, really add them
|
||||
@@ -302,10 +302,10 @@ QModelIndex EnvironmentModel::addVariable()
|
||||
|
||||
QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item)
|
||||
{
|
||||
if(m_mergedEnvironments) {
|
||||
if (m_mergedEnvironments) {
|
||||
bool existsInBaseEnvironment = (m_baseEnvironment.find(item.name) != m_baseEnvironment.constEnd());
|
||||
int rowInResult;
|
||||
if(existsInBaseEnvironment)
|
||||
if (existsInBaseEnvironment)
|
||||
rowInResult = findInResult(item.name);
|
||||
else
|
||||
rowInResult = findInResultInsertPosition(item.name);
|
||||
@@ -313,7 +313,7 @@ QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item)
|
||||
|
||||
qDebug()<<"addVariable "<<item.name<<existsInBaseEnvironment<<rowInResult<<rowInChanges;
|
||||
|
||||
if(existsInBaseEnvironment) {
|
||||
if (existsInBaseEnvironment) {
|
||||
m_items.insert(rowInChanges, item);
|
||||
updateResultEnvironment();
|
||||
emit dataChanged(index(rowInResult, 0, QModelIndex()), index(rowInResult, 1, QModelIndex()));
|
||||
@@ -340,11 +340,11 @@ QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item)
|
||||
|
||||
void EnvironmentModel::removeVariable(const QString &name)
|
||||
{
|
||||
if(m_mergedEnvironments) {
|
||||
if (m_mergedEnvironments) {
|
||||
int rowInResult = findInResult(name);
|
||||
int rowInChanges = findInChanges(name);
|
||||
bool existsInBaseEnvironment = m_baseEnvironment.find(name) != m_baseEnvironment.constEnd();
|
||||
if(existsInBaseEnvironment) {
|
||||
if (existsInBaseEnvironment) {
|
||||
m_items.removeAt(rowInChanges);
|
||||
updateResultEnvironment();
|
||||
emit dataChanged(index(rowInResult, 0, QModelIndex()), index(rowInResult, 1, QModelIndex()));
|
||||
@@ -368,11 +368,11 @@ void EnvironmentModel::removeVariable(const QString &name)
|
||||
|
||||
void EnvironmentModel::unset(const QString &name)
|
||||
{
|
||||
if(m_mergedEnvironments) {
|
||||
if (m_mergedEnvironments) {
|
||||
int row = findInResult(name);
|
||||
// look in m_items for the variable
|
||||
int pos = findInChanges(name);
|
||||
if(pos != -1) {
|
||||
if (pos != -1) {
|
||||
m_items[pos].unset = true;
|
||||
updateResultEnvironment();
|
||||
emit dataChanged(index(row, 0, QModelIndex()), index(row, 1, QModelIndex()));
|
||||
@@ -398,7 +398,7 @@ void EnvironmentModel::unset(const QString &name)
|
||||
bool EnvironmentModel::isUnset(const QString &name)
|
||||
{
|
||||
int pos = findInChanges(name);
|
||||
if(pos != -1)
|
||||
if (pos != -1)
|
||||
return m_items.at(pos).unset;
|
||||
else
|
||||
return false;
|
||||
|
||||
@@ -64,7 +64,7 @@ bool OutputPane::canFocus()
|
||||
|
||||
void OutputPane::setFocus()
|
||||
{
|
||||
if(m_tabWidget->currentWidget())
|
||||
if (m_tabWidget->currentWidget())
|
||||
m_tabWidget->currentWidget()->setFocus();
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ void OutputPane::createNewOutputWindow(RunControl *rc)
|
||||
|
||||
// First look if we can reuse a tab
|
||||
bool found = false;
|
||||
for(int i=0; i<m_tabWidget->count(); ++i) {
|
||||
for (int i=0; i<m_tabWidget->count(); ++i) {
|
||||
RunControl *old = runControlForTab(i);
|
||||
if (old->runConfiguration() == rc->runConfiguration() && !old->isRunning()) {
|
||||
// Reuse this tab
|
||||
|
||||
@@ -152,7 +152,7 @@ void PersistentSettingsWriter::writeValue(QDomElement &ps, const QVariant &varia
|
||||
QDomElement values = ps.ownerDocument().createElement("valuelist");
|
||||
values.setAttribute("type", QVariant::typeToName(QVariant::List));
|
||||
QList<QVariant> varList = variant.toList();
|
||||
foreach(QVariant var, varList) {
|
||||
foreach (QVariant var, varList) {
|
||||
writeValue(values, var);
|
||||
}
|
||||
ps.appendChild(values);
|
||||
|
||||
@@ -90,7 +90,7 @@ QList<ProjectFileFactory*> ProjectFileFactory::createFactories(const Core::ICore
|
||||
|
||||
const QString filterSeparator = QLatin1String(";;");
|
||||
filterString->clear();
|
||||
foreach(IProjectManager *manager, projectManagers) {
|
||||
foreach (IProjectManager *manager, projectManagers) {
|
||||
rc.push_back(new ProjectFileFactory(core, manager));
|
||||
if (!filterString->isEmpty())
|
||||
*filterString += filterSeparator;
|
||||
|
||||
@@ -54,7 +54,7 @@ bool ProcessStep::init(const QString &buildConfiguration)
|
||||
setEnvironment(buildConfiguration, project()->environment(buildConfiguration));
|
||||
QVariant wd = value(buildConfiguration, "workingDirectory").toString();
|
||||
QString workingDirectory;
|
||||
if(!wd.isValid() || wd.toString().isEmpty())
|
||||
if (!wd.isValid() || wd.toString().isEmpty())
|
||||
workingDirectory = "$BUILDDIR";
|
||||
else
|
||||
workingDirectory = wd.toString();
|
||||
@@ -161,7 +161,7 @@ QString ProcessStepConfigWidget::displayName() const
|
||||
void ProcessStepConfigWidget::workingDirBrowseButtonClicked()
|
||||
{
|
||||
QString workingDirectory = QFileDialog::getExistingDirectory(this, "Select the working directory", m_ui.workingDirectoryLineEdit->text());
|
||||
if(workingDirectory.isEmpty())
|
||||
if (workingDirectory.isEmpty())
|
||||
return;
|
||||
m_ui.workingDirectoryLineEdit->setText(workingDirectory);
|
||||
workingDirectoryLineEditTextEdited();
|
||||
@@ -170,7 +170,7 @@ void ProcessStepConfigWidget::workingDirBrowseButtonClicked()
|
||||
void ProcessStepConfigWidget::commandBrowseButtonClicked()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(this, "Select the executable");
|
||||
if(filename.isEmpty())
|
||||
if (filename.isEmpty())
|
||||
return;
|
||||
m_ui.commandLineEdit->setText(filename);
|
||||
commandLineEditTextEdited();
|
||||
@@ -179,7 +179,7 @@ void ProcessStepConfigWidget::commandBrowseButtonClicked()
|
||||
void ProcessStepConfigWidget::init(const QString &buildConfiguration)
|
||||
{
|
||||
m_buildConfiguration = buildConfiguration;
|
||||
if(buildConfiguration != QString::null) {
|
||||
if (buildConfiguration != QString::null) {
|
||||
m_ui.commandLineEdit->setText(m_step->command(buildConfiguration));
|
||||
|
||||
QString workingDirectory = m_step->value(buildConfiguration, "workingDirectory").toString();
|
||||
|
||||
@@ -57,11 +57,9 @@ void Project::insertBuildStep(int position, BuildStep *step)
|
||||
{
|
||||
m_buildSteps.insert(position, step);
|
||||
// check that the step has all the configurations
|
||||
foreach(const QString & name, buildConfigurations())
|
||||
{
|
||||
foreach (const QString &name, buildConfigurations())
|
||||
if (!step->getBuildConfiguration(name))
|
||||
step->addBuildConfiguration(name);
|
||||
}
|
||||
}
|
||||
|
||||
void Project::removeBuildStep(int position)
|
||||
@@ -80,11 +78,9 @@ void Project::insertCleanStep(int position, BuildStep *step)
|
||||
{
|
||||
m_cleanSteps.insert(position, step);
|
||||
// check that the step has all the configurations
|
||||
foreach(const QString & name, buildConfigurations())
|
||||
{
|
||||
foreach (const QString &name, buildConfigurations())
|
||||
if (!step->getBuildConfiguration(name))
|
||||
step->addBuildConfiguration(name);
|
||||
}
|
||||
}
|
||||
|
||||
void Project::removeCleanStep(int position)
|
||||
@@ -100,10 +96,10 @@ void Project::addBuildConfiguration(const QString &name)
|
||||
|
||||
m_buildConfigurationValues.push_back(new BuildConfiguration(name));
|
||||
|
||||
for (int i = 0; i!=m_buildSteps.size(); ++i)
|
||||
for (int i = 0; i != m_buildSteps.size(); ++i)
|
||||
m_buildSteps.at(i)->addBuildConfiguration(name);
|
||||
|
||||
for (int i = 0; i!=m_cleanSteps.size(); ++i)
|
||||
for (int i = 0; i != m_cleanSteps.size(); ++i)
|
||||
m_cleanSteps.at(i)->addBuildConfiguration(name);
|
||||
}
|
||||
|
||||
@@ -113,15 +109,15 @@ void Project::removeBuildConfiguration(const QString &name)
|
||||
return;
|
||||
|
||||
for (int i = 0; i != m_buildConfigurationValues.size(); ++i)
|
||||
if(m_buildConfigurationValues.at(i)->name() == name) {
|
||||
if (m_buildConfigurationValues.at(i)->name() == name) {
|
||||
delete m_buildConfigurationValues.at(i);
|
||||
m_buildConfigurationValues.removeAt(i);
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i!=m_buildSteps.size(); ++i)
|
||||
for (int i = 0; i != m_buildSteps.size(); ++i)
|
||||
m_buildSteps.at(i)->removeBuildConfiguration(name);
|
||||
for (int i = 0; i!=m_cleanSteps.size(); ++i)
|
||||
for (int i = 0; i != m_cleanSteps.size(); ++i)
|
||||
m_cleanSteps.at(i)->removeBuildConfiguration(name);
|
||||
|
||||
}
|
||||
@@ -132,22 +128,21 @@ void Project::copyBuildConfiguration(const QString &source, const QString &dest)
|
||||
return;
|
||||
|
||||
for (int i = 0; i != m_buildConfigurationValues.size(); ++i)
|
||||
if(m_buildConfigurationValues.at(i)->name() == source)
|
||||
if (m_buildConfigurationValues.at(i)->name() == source)
|
||||
m_buildConfigurationValues.push_back(new BuildConfiguration(dest, m_buildConfigurationValues.at(i)));
|
||||
|
||||
for (int i = 0; i!= m_buildSteps.size(); ++i)
|
||||
for (int i = 0; i != m_buildSteps.size(); ++i)
|
||||
m_buildSteps.at(i)->copyBuildConfiguration(source, dest);
|
||||
|
||||
for (int i = 0; i!= m_cleanSteps.size(); ++i)
|
||||
for (int i = 0; i != m_cleanSteps.size(); ++i)
|
||||
m_cleanSteps.at(i)->copyBuildConfiguration(source, dest);
|
||||
}
|
||||
|
||||
QStringList Project::buildConfigurations() const
|
||||
{
|
||||
QStringList result;
|
||||
foreach (BuildConfiguration *bc, m_buildConfigurationValues) {
|
||||
foreach (BuildConfiguration *bc, m_buildConfigurationValues)
|
||||
result << bc->name();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -195,39 +190,36 @@ void Project::saveSettingsImpl(PersistentSettingsWriter &writer)
|
||||
writer.saveValue("project", m_values);
|
||||
|
||||
//save buildsettings
|
||||
foreach(const QString & buildConfigurationName, buildConfigurations()) {
|
||||
foreach (const QString &buildConfigurationName, buildConfigurations()) {
|
||||
QMap<QString, QVariant> temp =
|
||||
getBuildConfiguration(buildConfigurationName)->toMap();
|
||||
writer.saveValue("buildConfiguration-" + buildConfigurationName, temp);
|
||||
}
|
||||
|
||||
QStringList buildStepNames;
|
||||
foreach(BuildStep * buildStep, buildSteps()) {
|
||||
foreach (BuildStep *buildStep, buildSteps())
|
||||
buildStepNames << buildStep->name();
|
||||
}
|
||||
writer.saveValue("buildsteps", buildStepNames);
|
||||
|
||||
QStringList cleanStepNames;
|
||||
foreach(BuildStep * cleanStep, cleanSteps()) {
|
||||
foreach (BuildStep *cleanStep, cleanSteps())
|
||||
cleanStepNames << cleanStep->name();
|
||||
}
|
||||
writer.saveValue("cleansteps", cleanStepNames);
|
||||
QStringList buildConfigurationNames = buildConfigurations();
|
||||
writer.saveValue("buildconfigurations", buildConfigurationNames );
|
||||
|
||||
//save buildstep configuration
|
||||
int buildstepnr = 0;
|
||||
foreach(BuildStep * buildStep, buildSteps())
|
||||
{
|
||||
foreach (BuildStep *buildStep, buildSteps()) {
|
||||
QMap<QString, QVariant> buildConfiguration = buildStep->valuesToMap();
|
||||
writer.saveValue("buildstep" + QString().setNum(buildstepnr), buildConfiguration);
|
||||
++buildstepnr;
|
||||
}
|
||||
|
||||
// save each buildstep/buildConfiguration combination
|
||||
foreach(const QString & buildConfigurationName, buildConfigurationNames) {
|
||||
foreach (const QString &buildConfigurationName, buildConfigurationNames) {
|
||||
buildstepnr = 0;
|
||||
foreach(BuildStep * buildStep, buildSteps()) {
|
||||
foreach (BuildStep *buildStep, buildSteps()) {
|
||||
QMap<QString, QVariant> temp =
|
||||
buildStep->valuesToMap(buildConfigurationName);
|
||||
writer.saveValue("buildconfiguration-" + buildConfigurationName + "-buildstep" + QString().setNum(buildstepnr), temp);
|
||||
@@ -237,17 +229,16 @@ void Project::saveSettingsImpl(PersistentSettingsWriter &writer)
|
||||
|
||||
//save cleansteps buildconfiguration
|
||||
int cleanstepnr = 0;
|
||||
foreach(BuildStep * cleanStep, cleanSteps())
|
||||
{
|
||||
foreach (BuildStep *cleanStep, cleanSteps()) {
|
||||
QMap<QString, QVariant> buildConfiguration = cleanStep->valuesToMap();
|
||||
writer.saveValue("cleanstep" + QString().setNum(cleanstepnr), buildConfiguration);
|
||||
++cleanstepnr;
|
||||
}
|
||||
|
||||
// save each cleanstep/buildConfiguration combination
|
||||
foreach(const QString & buildConfigurationName, buildConfigurationNames) {
|
||||
foreach (const QString &buildConfigurationName, buildConfigurationNames) {
|
||||
cleanstepnr = 0;
|
||||
foreach(BuildStep * cleanStep, cleanSteps()) {
|
||||
foreach (BuildStep *cleanStep, cleanSteps()) {
|
||||
QMap<QString, QVariant> temp = cleanStep->valuesToMap(buildConfigurationName);
|
||||
writer.saveValue("buildconfiguration-" + buildConfigurationName + "-cleanstep" + QString().setNum(cleanstepnr), temp);
|
||||
++cleanstepnr;
|
||||
@@ -279,7 +270,7 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader)
|
||||
|
||||
//Build Settings
|
||||
const QStringList buildConfigurationNames = reader.restoreValue("buildconfigurations").toStringList();
|
||||
foreach(const QString & buildConfigurationName, buildConfigurationNames) {
|
||||
foreach (const QString &buildConfigurationName, buildConfigurationNames) {
|
||||
addBuildConfiguration(buildConfigurationName);
|
||||
QMap<QString, QVariant> temp =
|
||||
reader.restoreValue("buildConfiguration-" + buildConfigurationName).toMap();
|
||||
@@ -287,16 +278,16 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader)
|
||||
}
|
||||
|
||||
QVariant buildStepsVariant = reader.restoreValue("buildsteps");
|
||||
if(buildStepsVariant.isValid()) {
|
||||
if (buildStepsVariant.isValid()) {
|
||||
// restoring BuildSteps from settings
|
||||
int pos = 0;
|
||||
const QList<IBuildStepFactory *> buildStepFactories =
|
||||
ExtensionSystem::PluginManager::instance()->getObjects<IBuildStepFactory>();
|
||||
QStringList buildStepNames = buildStepsVariant.toStringList();
|
||||
foreach(const QString & buildStepName, buildStepNames) {
|
||||
foreach(IBuildStepFactory * factory, buildStepFactories) {
|
||||
if(factory->canCreate(buildStepName)) {
|
||||
BuildStep * buildStep = factory->create(this, buildStepName);
|
||||
foreach (const QString &buildStepName, buildStepNames) {
|
||||
foreach (IBuildStepFactory *factory, buildStepFactories) {
|
||||
if (factory->canCreate(buildStepName)) {
|
||||
BuildStep *buildStep = factory->create(this, buildStepName);
|
||||
insertBuildStep(pos, buildStep);
|
||||
++pos;
|
||||
break;
|
||||
@@ -307,10 +298,10 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader)
|
||||
QStringList cleanStepNames = reader.restoreValue("cleansteps").toStringList();
|
||||
// restoring BuildSteps from settings
|
||||
pos = 0;
|
||||
foreach(const QString & cleanStepName, cleanStepNames) {
|
||||
foreach(IBuildStepFactory * factory, buildStepFactories) {
|
||||
if(factory->canCreate(cleanStepName)) {
|
||||
BuildStep * cleanStep = factory->create(this, cleanStepName);
|
||||
foreach (const QString &cleanStepName, cleanStepNames) {
|
||||
foreach (IBuildStepFactory *factory, buildStepFactories) {
|
||||
if (factory->canCreate(cleanStepName)) {
|
||||
BuildStep *cleanStep = factory->create(this, cleanStepName);
|
||||
insertCleanStep(pos, cleanStep);
|
||||
++pos;
|
||||
break;
|
||||
@@ -324,15 +315,15 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader)
|
||||
|
||||
// restore BuildSteps configuration
|
||||
int buildstepnr = 0;
|
||||
foreach(BuildStep * buildStep, buildSteps()) {
|
||||
foreach (BuildStep *buildStep, buildSteps()) {
|
||||
QMap<QString, QVariant> buildConfiguration = reader.restoreValue("buildstep" + QString().setNum(buildstepnr)).toMap();
|
||||
buildStep->setValuesFromMap(buildConfiguration);
|
||||
++buildstepnr;
|
||||
}
|
||||
|
||||
foreach(const QString & buildConfigurationName, buildConfigurationNames) {
|
||||
foreach (const QString &buildConfigurationName, buildConfigurationNames) {
|
||||
buildstepnr = 0;
|
||||
foreach(BuildStep * buildStep, buildSteps()) {
|
||||
foreach (BuildStep *buildStep, buildSteps()) {
|
||||
//get the buildconfiguration for this build step
|
||||
QMap<QString, QVariant> buildConfiguration =
|
||||
reader.restoreValue("buildconfiguration-" + buildConfigurationName + "-buildstep" + QString().setNum(buildstepnr)).toMap();
|
||||
@@ -343,16 +334,15 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader)
|
||||
|
||||
// restore CleanSteps configuration
|
||||
int cleanstepnr = 0;
|
||||
foreach(BuildStep * cleanStep, cleanSteps())
|
||||
{
|
||||
foreach (BuildStep *cleanStep, cleanSteps()) {
|
||||
QMap<QString, QVariant> buildConfiguration = reader.restoreValue("cleanstep" + QString().setNum(cleanstepnr)).toMap();
|
||||
cleanStep->setValuesFromMap(buildConfiguration);
|
||||
++cleanstepnr;
|
||||
}
|
||||
|
||||
foreach(const QString & buildConfigurationName, buildConfigurationNames) {
|
||||
foreach (const QString &buildConfigurationName, buildConfigurationNames) {
|
||||
cleanstepnr = 0;
|
||||
foreach(BuildStep * cleanStep, cleanSteps()) {
|
||||
foreach (BuildStep *cleanStep, cleanSteps()) {
|
||||
//get the buildconfiguration for this clean step
|
||||
QMap<QString, QVariant> buildConfiguration =
|
||||
reader.restoreValue("buildconfiguration-" + buildConfigurationName + "-cleanstep" + QString().setNum(cleanstepnr)).toMap();
|
||||
@@ -373,7 +363,7 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader)
|
||||
if (!typeVariant.isValid())
|
||||
break;
|
||||
const QString &type = typeVariant.toString();
|
||||
foreach (IRunConfigurationFactory * factory, factories) {
|
||||
foreach (IRunConfigurationFactory *factory, factories) {
|
||||
if (factory->canCreate(type)) {
|
||||
QSharedPointer<RunConfiguration> rc = factory->create(this, type);
|
||||
rc->restore(reader);
|
||||
@@ -403,7 +393,7 @@ QVariant Project::value(const QString &name) const
|
||||
{
|
||||
QMap<QString, QVariant>::const_iterator it =
|
||||
m_values.find(name);
|
||||
if(it != m_values.constEnd())
|
||||
if (it != m_values.constEnd())
|
||||
return it.value();
|
||||
else
|
||||
return QVariant();
|
||||
@@ -497,7 +487,7 @@ QString Project::displayNameFor(const QString &buildConfiguration)
|
||||
void Project::setDisplayNameFor(const QString &buildConfiguration, const QString &displayName)
|
||||
{
|
||||
QStringList displayNames;
|
||||
foreach(const QString &bc, buildConfigurations()) {
|
||||
foreach (const QString &bc, buildConfigurations()) {
|
||||
if (bc != buildConfiguration)
|
||||
displayNames << displayNameFor(bc);
|
||||
}
|
||||
|
||||
@@ -734,7 +734,7 @@ void ProjectExplorerPlugin::clearSession()
|
||||
void ProjectExplorerPlugin::extensionsInitialized()
|
||||
{
|
||||
m_fileFactories = ProjectFileFactory::createFactories(m_core, &m_projectFilterString);
|
||||
foreach(ProjectFileFactory *pf, m_fileFactories) {
|
||||
foreach (ProjectFileFactory *pf, m_fileFactories) {
|
||||
m_profileMimeTypes += pf->mimeTypes();
|
||||
addAutoReleasedObject(pf);
|
||||
}
|
||||
@@ -1212,7 +1212,7 @@ QStringList ProjectExplorerPlugin::allFilesWithDependencies(Project *pro)
|
||||
qDebug() << "ProjectExplorerPlugin::allFilesWithDependencies(" << pro->file()->fileName() << ")";
|
||||
|
||||
QStringList filesToSave;
|
||||
foreach(Project *p, m_session->projectOrder(pro)) {
|
||||
foreach (Project *p, m_session->projectOrder(pro)) {
|
||||
FindAllFilesVisitor filesVisitor;
|
||||
p->rootProjectNode()->accept(&filesVisitor);
|
||||
filesToSave << filesVisitor.filePaths();
|
||||
@@ -1783,7 +1783,7 @@ void ProjectExplorerPlugin::updateSessionMenu()
|
||||
{
|
||||
m_sessionMenu->clear();
|
||||
const QString &activeSession = m_session->activeSession();
|
||||
foreach(const QString &session, m_session->sessions()) {
|
||||
foreach (const QString &session, m_session->sessions()) {
|
||||
QAction *act = m_sessionMenu->addAction(session, this, SLOT(setSession()));
|
||||
act->setCheckable(true);
|
||||
if (session == activeSession)
|
||||
|
||||
@@ -988,10 +988,9 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList)
|
||||
return;
|
||||
}
|
||||
|
||||
while(true)
|
||||
{
|
||||
while (true) {
|
||||
// Skip all that are the same
|
||||
while(*oldIter == *newIter) {
|
||||
while (*oldIter == *newIter) {
|
||||
++oldIter;
|
||||
++newIter;
|
||||
if (oldIter == oldNodeList.constEnd()) {
|
||||
@@ -1002,7 +1001,7 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList)
|
||||
int count = newIter - startOfBlock;
|
||||
if (count > 0) {
|
||||
beginInsertRows(parentIndex, pos, pos+count-1);
|
||||
while(startOfBlock != newIter) {
|
||||
while (startOfBlock != newIter) {
|
||||
oldNodeList.insert(pos, *startOfBlock);
|
||||
++pos;
|
||||
++startOfBlock;
|
||||
@@ -1015,7 +1014,7 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList)
|
||||
}
|
||||
|
||||
QList<Node *>::const_iterator startOfBlock = newIter;
|
||||
while(*oldIter != *newIter)
|
||||
while (*oldIter != *newIter)
|
||||
++newIter;
|
||||
// startOfBlock is the first that was diffrent
|
||||
// newIter points to the new position of oldIter
|
||||
@@ -1024,7 +1023,7 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList)
|
||||
int pos = oldIter - oldNodeList.constBegin();
|
||||
int count = newIter - startOfBlock;
|
||||
beginInsertRows(parentIndex, pos, pos + count - 1);
|
||||
while(startOfBlock != newIter) {
|
||||
while (startOfBlock != newIter) {
|
||||
oldNodeList.insert(pos, *startOfBlock);
|
||||
++pos;
|
||||
++startOfBlock;
|
||||
@@ -1059,10 +1058,9 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList)
|
||||
return;
|
||||
}
|
||||
|
||||
while(true)
|
||||
{
|
||||
while (true) {
|
||||
// Skip all that are the same
|
||||
while(*oldIter == *newIter) {
|
||||
while (*oldIter == *newIter) {
|
||||
++oldIter;
|
||||
++newIter;
|
||||
if (newIter == newNodeList.constEnd()) {
|
||||
@@ -1073,7 +1071,7 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList)
|
||||
int count = oldIter - startOfBlock;
|
||||
if (count > 0) {
|
||||
beginRemoveRows(parentIndex, pos, pos+count-1);
|
||||
while(startOfBlock != oldIter) {
|
||||
while (startOfBlock != oldIter) {
|
||||
++startOfBlock;
|
||||
oldNodeList.removeAt(pos);
|
||||
}
|
||||
@@ -1086,7 +1084,7 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList)
|
||||
}
|
||||
|
||||
QList<Node *>::const_iterator startOfBlock = oldIter;
|
||||
while(*oldIter != *newIter)
|
||||
while (*oldIter != *newIter)
|
||||
++oldIter;
|
||||
// startOfBlock is the first that was diffrent
|
||||
// oldIter points to the new position of newIter
|
||||
@@ -1095,7 +1093,7 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList)
|
||||
int pos = startOfBlock - oldNodeList.constBegin();
|
||||
int count = oldIter - startOfBlock;
|
||||
beginRemoveRows(parentIndex, pos, pos + count - 1);
|
||||
while(startOfBlock != oldIter) {
|
||||
while (startOfBlock != oldIter) {
|
||||
++startOfBlock;
|
||||
oldNodeList.removeAt(pos);
|
||||
}
|
||||
@@ -1125,7 +1123,7 @@ void FlatModel::foldersAdded()
|
||||
void FlatModel::foldersAboutToBeRemoved(FolderNode *parentFolder, const QList<FolderNode*> &staleFolders)
|
||||
{
|
||||
QSet<Node *> blackList;
|
||||
foreach(FolderNode * node, staleFolders)
|
||||
foreach (FolderNode *node, staleFolders)
|
||||
blackList.insert(node);
|
||||
|
||||
FolderNode *folderNode = visibleFolderNode(parentFolder);
|
||||
@@ -1137,7 +1135,7 @@ void FlatModel::foldersAboutToBeRemoved(FolderNode *parentFolder, const QList<Fo
|
||||
|
||||
void FlatModel::removeFromCache(QList<FolderNode *> list)
|
||||
{
|
||||
foreach(FolderNode * fn, list) {
|
||||
foreach (FolderNode *fn, list) {
|
||||
removeFromCache(fn->subFolderNodes());
|
||||
m_childNodes.remove(fn);
|
||||
}
|
||||
@@ -1170,7 +1168,7 @@ void FlatModel::filesAboutToBeRemoved(FolderNode *folder, const QList<FileNode*>
|
||||
FolderNode *folderNode = visibleFolderNode(folder);
|
||||
|
||||
QSet<Node *> blackList;
|
||||
foreach(Node* node, staleFiles)
|
||||
foreach(Node *node, staleFiles)
|
||||
blackList.insert(node);
|
||||
|
||||
// Now get the new List for that folder
|
||||
|
||||
@@ -230,13 +230,11 @@ void ProjectWindow::updateTreeWidget()
|
||||
Project *ProjectWindow::findProject(const QString &path) const
|
||||
{
|
||||
QList<Project*> projects = m_session->projects();
|
||||
foreach(Project* project, projects) {
|
||||
if (project->file()->fileName() == path) {
|
||||
foreach (Project* project, projects)
|
||||
if (project->file()->fileName() == path)
|
||||
return project;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ProjectWindow::handleCurrentItemChanged(QTreeWidgetItem *current)
|
||||
@@ -244,7 +242,6 @@ void ProjectWindow::handleCurrentItemChanged(QTreeWidgetItem *current)
|
||||
if (current) {
|
||||
QString path = current->text(2);
|
||||
if (Project *project = findProject(path)) {
|
||||
|
||||
m_projectExplorer->setCurrentFile(project, path);
|
||||
showProperties(project, QModelIndex());
|
||||
return;
|
||||
|
||||
@@ -99,7 +99,7 @@ void ProjectWizardPage::setAddToVersionControlEnabled(bool b)
|
||||
|
||||
void ProjectWizardPage::changeEvent(QEvent *e)
|
||||
{
|
||||
switch(e->type()) {
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
m_ui->retranslateUi(this);
|
||||
break;
|
||||
@@ -115,7 +115,8 @@ void ProjectWizardPage::setVCSDisplay(const QString &vcsName)
|
||||
|
||||
void ProjectWizardPage::setFilesDisplay(const QStringList &files)
|
||||
{
|
||||
QString fileMessage; {
|
||||
QString fileMessage;
|
||||
{
|
||||
QTextStream str(&fileMessage);
|
||||
str << "<html>Files to be added:<pre>";
|
||||
const QStringList::const_iterator cend = files.constEnd();
|
||||
|
||||
@@ -59,7 +59,7 @@ bool RemoveFileDialog::isDeleteFileChecked() const
|
||||
|
||||
void RemoveFileDialog::changeEvent(QEvent *e)
|
||||
{
|
||||
switch(e->type()) {
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
m_ui->retranslateUi(this);
|
||||
break;
|
||||
|
||||
@@ -387,10 +387,10 @@ SessionManager::SessionManager(Core::ICore *core, QObject *parent)
|
||||
dir.mkpath(configDir + "/qtcreator");
|
||||
|
||||
// Move sessions to that directory
|
||||
foreach(const QString &session, sessions()) {
|
||||
foreach (const QString &session, sessions()) {
|
||||
QFile file(configDir + "/" + session + ".qws");
|
||||
if (file.exists())
|
||||
if(file.copy(configDir + "/qtcreator/" + session + ".qws"))
|
||||
if (file.copy(configDir + "/qtcreator/" + session + ".qws"))
|
||||
file.remove();
|
||||
}
|
||||
}
|
||||
@@ -413,15 +413,15 @@ SessionManager::~SessionManager()
|
||||
|
||||
bool SessionManager::isDefaultVirgin() const
|
||||
{
|
||||
return (isDefaultSession(m_sessionName)
|
||||
return isDefaultSession(m_sessionName)
|
||||
&& projects().isEmpty()
|
||||
&& m_core->editorManager()->openedEditors().isEmpty());
|
||||
&& m_core->editorManager()->openedEditors().isEmpty();
|
||||
}
|
||||
|
||||
|
||||
bool SessionManager::isDefaultSession(const QString &session) const
|
||||
{
|
||||
return (session == QLatin1String("default"));
|
||||
return session == QLatin1String("default");
|
||||
}
|
||||
|
||||
|
||||
@@ -1082,7 +1082,7 @@ bool SessionManager::loadSession(const QString &session)
|
||||
}
|
||||
} else {
|
||||
// Create a new session with that name
|
||||
if(!createImpl(sessionNameToFileName(session)))
|
||||
if (!createImpl(sessionNameToFileName(session)))
|
||||
return false;
|
||||
updateName(session);
|
||||
return true;
|
||||
|
||||
@@ -128,7 +128,7 @@ SessionDialog::SessionDialog(SessionManager *sessionManager, const QString &last
|
||||
this, SLOT(updateActions()));
|
||||
|
||||
QStringList sessions = sessionManager->sessions();
|
||||
foreach(const QString &session, sessions) {
|
||||
foreach (const QString &session, sessions) {
|
||||
m_ui.sessionList->addItem(session);
|
||||
if (session == lastSession)
|
||||
m_ui.sessionList->setCurrentRow(m_ui.sessionList->count() - 1);
|
||||
|
||||
@@ -441,7 +441,7 @@ QSize TaskDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelInd
|
||||
int height = 0;
|
||||
QTextLayout tl(description);
|
||||
tl.beginLayout();
|
||||
while(true) {
|
||||
while (true) {
|
||||
QTextLine line = tl.createLine();
|
||||
if (!line.isValid())
|
||||
break;
|
||||
@@ -528,7 +528,7 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
|
||||
int height = 0;
|
||||
QTextLayout tl(description);
|
||||
tl.beginLayout();
|
||||
while(true) {
|
||||
while (true) {
|
||||
QTextLine line = tl.createLine();
|
||||
if (!line.isValid())
|
||||
break;
|
||||
|
||||
@@ -41,13 +41,13 @@ using namespace Qt4ProjectManager::Internal;
|
||||
using ProjectExplorer::Environment;
|
||||
|
||||
CeSdkInfo::CeSdkInfo()
|
||||
: m_major(0) , m_minor(0)
|
||||
: m_major(0), m_minor(0)
|
||||
{
|
||||
}
|
||||
|
||||
Environment CeSdkInfo::addToEnvironment(const Environment &env)
|
||||
{
|
||||
qDebug()<<"adding "<<name()<< "to Environment";
|
||||
qDebug() << "adding " << name() << "to Environment";
|
||||
Environment e(env);
|
||||
e.set("INCLUDE", m_include);
|
||||
e.set("LIB", m_lib);
|
||||
@@ -66,21 +66,21 @@ QString CeSdkHandler::platformName(const QString &qtpath)
|
||||
QString CE_SDK;
|
||||
QString CE_ARCH;
|
||||
QFile f(qtpath);
|
||||
if(f.exists() && f.open(QIODevice::ReadOnly)) {
|
||||
while(!f.atEnd()) {
|
||||
if (f.exists() && f.open(QIODevice::ReadOnly)) {
|
||||
while (!f.atEnd()) {
|
||||
QByteArray line = f.readLine();
|
||||
if(line.startsWith("CE_SDK")) {
|
||||
if (line.startsWith("CE_SDK")) {
|
||||
int index = line.indexOf('=');
|
||||
if(index >= 0) {
|
||||
if (index >= 0) {
|
||||
CE_SDK = line.mid(index + 1).trimmed();
|
||||
}
|
||||
} else if(line.startsWith("CE_ARCH")) {
|
||||
} else if (line.startsWith("CE_ARCH")) {
|
||||
int index = line.indexOf('=');
|
||||
if(index >= 0) {
|
||||
if (index >= 0) {
|
||||
CE_ARCH = line.mid(index + 1).trimmed();
|
||||
}
|
||||
}
|
||||
if(!CE_SDK.isEmpty() && !CE_ARCH.isEmpty()) {
|
||||
if (!CE_SDK.isEmpty() && !CE_ARCH.isEmpty()) {
|
||||
platformName = CE_SDK + " (" + CE_ARCH + ")";
|
||||
break;
|
||||
}
|
||||
@@ -146,9 +146,9 @@ bool CeSdkHandler::parse(const QString &vsdir)
|
||||
|
||||
CeSdkInfo CeSdkHandler::find(const QString &name)
|
||||
{
|
||||
qDebug()<<"looking for platform "<<name;
|
||||
qDebug() << "looking for platform " << name;
|
||||
for (QList<CeSdkInfo>::iterator it = m_list.begin(); it != m_list.end(); ++it) {
|
||||
qDebug()<<"...."<<it->name();
|
||||
qDebug() << "...." << it->name();
|
||||
if (it->name() == name)
|
||||
return *it;
|
||||
}
|
||||
|
||||
@@ -60,9 +60,9 @@ bool DeployHelperRunStep::init(const QString &configuration)
|
||||
//find target
|
||||
m_exec = "";
|
||||
QStringList targets = QStringList(); //TODO fix m_pro->qmakeTarget();
|
||||
foreach(const QString& target, targets) {
|
||||
foreach (const QString &target, targets) {
|
||||
QFileInfo fi(m_appdir + QLatin1Char('/') + target);
|
||||
if(fi.exists())
|
||||
if (fi.exists())
|
||||
m_exec = target;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ void GdbMacrosBuildStep::run(QFutureInterface<bool> & fi)
|
||||
QString destDir = m_buildDirectory + "/qtc-gdbmacros/";
|
||||
QDir dir;
|
||||
dir.mkpath(destDir);
|
||||
foreach(const QString &file, files) {
|
||||
foreach (const QString &file, files) {
|
||||
QFile destination(destDir + file);
|
||||
if (destination.exists())
|
||||
destination.remove();
|
||||
@@ -116,7 +116,7 @@ void GdbMacrosBuildStep::run(QFutureInterface<bool> & fi)
|
||||
QStringList makeargs = ms->value(m_buildConfiguration, "makeargs").toStringList();
|
||||
if (makeargs.contains("debug")) {
|
||||
makeArguments << "debug";
|
||||
} else if(makeargs.contains("release")) {
|
||||
} else if (makeargs.contains("release")) {
|
||||
makeArguments << "release";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ ProjectExplorer::BuildParserInterface *MakeStep::buildParser(const QtVersion * c
|
||||
{
|
||||
QString buildParser;
|
||||
QtVersion::ToolchainType type = version->toolchainType();
|
||||
if( type == QtVersion::MSVC || type == QtVersion::WINCE)
|
||||
if ( type == QtVersion::MSVC || type == QtVersion::WINCE)
|
||||
buildParser = Constants::BUILD_PARSER_MSVC;
|
||||
else
|
||||
buildParser = Constants::BUILD_PARSER_GCC;
|
||||
@@ -92,18 +92,18 @@ bool MakeStep::init(const QString &name)
|
||||
QString workingDirectory;
|
||||
if (project()->value(name, "useShadowBuild").toBool())
|
||||
workingDirectory = project()->value(name, "buildDirectory").toString();
|
||||
if(workingDirectory.isEmpty())
|
||||
if (workingDirectory.isEmpty())
|
||||
workingDirectory = QFileInfo(project()->file()->fileName()).absolutePath();
|
||||
setWorkingDirectory(name, workingDirectory);
|
||||
|
||||
//NBS only dependency on Qt4Project, we probably simply need a MakeProject from which Qt4Project derives
|
||||
QString makeCmd = qobject_cast<Qt4Project *>(project())->qtVersion(name)->makeCommand();
|
||||
if(!value(name, "makeCmd").toString().isEmpty())
|
||||
if (!value(name, "makeCmd").toString().isEmpty())
|
||||
makeCmd = value(name, "makeCmd").toString();
|
||||
if (!QFileInfo(makeCmd).isAbsolute()) {
|
||||
// Try to detect command in environment
|
||||
QString tmp = environment.searchInPath(makeCmd);
|
||||
if(tmp == QString::null) {
|
||||
if (tmp == QString::null) {
|
||||
emit addToOutputWindow(tr("<font color=\"#ff0000\">Could not find make command: %1 "\
|
||||
"in the build environment</font>").arg(makeCmd));
|
||||
return false;
|
||||
@@ -291,7 +291,7 @@ void MakeStepConfigWidget::init(const QString &buildConfiguration)
|
||||
bool showPage0 = buildConfiguration.isNull();
|
||||
m_ui.stackedWidget->setCurrentIndex(showPage0? 0 : 1);
|
||||
|
||||
if(!showPage0) {
|
||||
if (!showPage0) {
|
||||
Qt4Project *pro = qobject_cast<Qt4Project *>(m_makeStep->project());
|
||||
m_ui.makeLabel->setText(tr("Override %1:").arg(pro->qtVersion(buildConfiguration)->makeCommand()));
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ QList<MSVCEnvironment> MSVCEnvironment::availableVersions()
|
||||
QSettings registry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7",
|
||||
QSettings::NativeFormat);
|
||||
QStringList versions = registry.allKeys();
|
||||
foreach(const QString &version, versions) {
|
||||
foreach (const QString &version, versions) {
|
||||
QString dir = registry.value(version).toString();
|
||||
result << MSVCEnvironment(version, dir);
|
||||
}
|
||||
@@ -92,7 +92,7 @@ Environment MSVCEnvironment::addToEnvironment(const Environment &env) const
|
||||
QString varsbat = m_path + "Common7\\Tools\\vsvars32.bat";
|
||||
if (QFileInfo(varsbat).exists()) {
|
||||
QTemporaryFile tf(QDir::tempPath() + "\\XXXXXX.bat");
|
||||
if(!tf.open())
|
||||
if (!tf.open())
|
||||
return e;
|
||||
QString filename = tf.fileName();
|
||||
tf.write("call \"" + varsbat.toLocal8Bit()+"\"\r\n");
|
||||
@@ -107,13 +107,13 @@ Environment MSVCEnvironment::addToEnvironment(const Environment &env) const
|
||||
tf.close();
|
||||
|
||||
QFile vars(QDir::tempPath() + "\\qtcreator-msvc-environment.txt");
|
||||
if(vars.exists() && vars.open(QIODevice::ReadOnly)) {
|
||||
while(!vars.atEnd()) {
|
||||
if (vars.exists() && vars.open(QIODevice::ReadOnly)) {
|
||||
while (!vars.atEnd()) {
|
||||
QByteArray line = vars.readLine();
|
||||
QString line2 = QString::fromLocal8Bit(line);
|
||||
line2 = line2.trimmed();
|
||||
QRegExp regexp("(\\w*)=(.*)");
|
||||
if(regexp.exactMatch(line2)) {
|
||||
if (regexp.exactMatch(line2)) {
|
||||
QString variable = regexp.cap(1);
|
||||
QString value = regexp.cap(2);
|
||||
value.replace('%' + variable + '%', e.value(variable));
|
||||
@@ -137,13 +137,13 @@ Environment MSVCEnvironment::addToEnvironment(const Environment &env) const
|
||||
|
||||
|
||||
// QFile varsbat(m_path + "Common7\\Tools\\vsvars32.bat");
|
||||
// if(varsbat.exists() && varsbat.open(QIODevice::ReadOnly)) {
|
||||
// while(!varsbat.atEnd()) {
|
||||
// if (varsbat.exists() && varsbat.open(QIODevice::ReadOnly)) {
|
||||
// while (!varsbat.atEnd()) {
|
||||
// QByteArray line = varsbat.readLine();
|
||||
// QString line2 = QString::fromLocal8Bit(line);
|
||||
// line2 = line2.trimmed();
|
||||
// QRegExp regexp("\\s*@?(S|s)(E|e)(T|t)\\s*(\\w*)=(.*)");
|
||||
// if(regexp.exactMatch(line2)) {
|
||||
// if (regexp.exactMatch(line2)) {
|
||||
// QString variable = regexp.cap(4);
|
||||
// QString value = regexp.cap(5);
|
||||
// value.replace('%' + variable + '%', e.value(variable));
|
||||
|
||||
@@ -45,7 +45,7 @@ ProFileReader::ProFileReader()
|
||||
|
||||
ProFileReader::~ProFileReader()
|
||||
{
|
||||
foreach(ProFile *pf, m_proFiles)
|
||||
foreach (ProFile *pf, m_proFiles)
|
||||
delete pf;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ QStringList QMakeStep::arguments(const QString &buildConfiguration)
|
||||
QStringList arguments;
|
||||
arguments << project()->file()->fileName();
|
||||
if (!additonalArguments.contains("-spec")) {
|
||||
if(m_pro->value("useVBOX").toBool()) { //NBS TODO don't special case VBOX like this
|
||||
if (m_pro->value("useVBOX").toBool()) { //NBS TODO don't special case VBOX like this
|
||||
arguments << "-spec" << "linux-i686fb-g++";
|
||||
arguments << "-unix";
|
||||
} else {
|
||||
@@ -116,7 +116,7 @@ bool QMakeStep::init(const QString &name)
|
||||
QString workingDirectory = m_pro->buildDirectory(name);
|
||||
|
||||
Environment environment = m_pro->environment(name);
|
||||
if(!environment.value("QMAKESPEC").isEmpty() && environment.value("QMAKESPEC") != qtVersion->mkspec())
|
||||
if (!environment.value("QMAKESPEC").isEmpty() && environment.value("QMAKESPEC") != qtVersion->mkspec())
|
||||
emit addToOutputWindow(tr("QMAKESPEC set to ") + environment.value("QMAKESPEC") +
|
||||
tr(" overrides mkspec of selected qt ")+qtVersion->mkspec());
|
||||
|
||||
|
||||
@@ -118,31 +118,31 @@ void Qt4BuildConfigWidget::setupQtVersionsComboBox()
|
||||
if (m_buildConfiguration.isEmpty()) // not yet initialized
|
||||
return;
|
||||
|
||||
disconnect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(const QString &)),
|
||||
this, SLOT(qtVersionComboBoxCurrentIndexChanged(const QString &)));
|
||||
disconnect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)),
|
||||
this, SLOT(qtVersionComboBoxCurrentIndexChanged(QString)));
|
||||
|
||||
m_ui->qtVersionComboBox->clear();
|
||||
m_ui->qtVersionComboBox->addItem(tr("Default Qt Version"), 0);
|
||||
|
||||
if(m_pro->qtVersionId(m_buildConfiguration) == 0) {
|
||||
if (m_pro->qtVersionId(m_buildConfiguration) == 0) {
|
||||
m_ui->qtVersionComboBox->setCurrentIndex(0);
|
||||
m_ui->invalidQtWarningLabel->setVisible(false);
|
||||
}
|
||||
// Add Qt Versions to the combo box
|
||||
QtVersionManager *vm = m_pro->qt4ProjectManager()->versionManager();
|
||||
const QList<QtVersion *> &versions = vm->versions();
|
||||
for(int i=0; i<versions.size(); ++i) {
|
||||
for (int i = 0; i < versions.size(); ++i) {
|
||||
m_ui->qtVersionComboBox->addItem(versions.at(i)->name(), versions.at(i)->uniqueId());
|
||||
|
||||
if(versions.at(i)->uniqueId() == m_pro->qtVersionId(m_buildConfiguration)) {
|
||||
m_ui->qtVersionComboBox->setCurrentIndex(i+1);
|
||||
if (versions.at(i)->uniqueId() == m_pro->qtVersionId(m_buildConfiguration)) {
|
||||
m_ui->qtVersionComboBox->setCurrentIndex(i + 1);
|
||||
m_ui->invalidQtWarningLabel->setVisible(!versions.at(i)->isValid());
|
||||
}
|
||||
}
|
||||
|
||||
// And connect again
|
||||
connect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(const QString &)),
|
||||
this, SLOT(qtVersionComboBoxCurrentIndexChanged(const QString &)));
|
||||
connect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)),
|
||||
this, SLOT(qtVersionComboBoxCurrentIndexChanged(QString)));
|
||||
}
|
||||
|
||||
void Qt4BuildConfigWidget::shadowBuildButtonClicked()
|
||||
@@ -180,7 +180,7 @@ void Qt4BuildConfigWidget::shadowBuildLineEditTextChanged()
|
||||
m_ui->importLabel->setVisible(false);
|
||||
if (m_ui->shadowBuildCheckBox->isChecked()) {
|
||||
QString qtPath = m_pro->qt4ProjectManager()->versionManager()->findQtVersionFromMakefile(m_ui->shadowBuildLineEdit->text());
|
||||
if(!qtPath.isEmpty()) {
|
||||
if (!qtPath.isEmpty()) {
|
||||
m_ui->importLabel->setVisible(true);
|
||||
}
|
||||
}
|
||||
@@ -252,7 +252,7 @@ void Qt4BuildConfigWidget::qtVersionComboBoxCurrentIndexChanged(const QString &)
|
||||
}
|
||||
bool isValid = m_pro->qt4ProjectManager()->versionManager()->version(newQtVersion)->isValid();
|
||||
m_ui->invalidQtWarningLabel->setVisible(!isValid);
|
||||
if(newQtVersion != m_pro->qtVersionId(m_buildConfiguration)) {
|
||||
if (newQtVersion != m_pro->qtVersionId(m_buildConfiguration)) {
|
||||
m_pro->setQtVersion(m_buildConfiguration, newQtVersion);
|
||||
m_pro->update();
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ void Qt4BuildEnvironmentWidget::removeEnvironmentButtonClicked()
|
||||
void Qt4BuildEnvironmentWidget::unsetEnvironmentButtonClicked()
|
||||
{
|
||||
const QString &name = m_environmentModel->indexToVariable(m_ui->environmentTreeView->currentIndex());
|
||||
if(!m_environmentModel->isInBaseEnvironment(name) && m_environmentModel->mergedEnvironments())
|
||||
if (!m_environmentModel->isInBaseEnvironment(name) && m_environmentModel->mergedEnvironments())
|
||||
m_environmentModel->removeVariable(name);
|
||||
else
|
||||
m_environmentModel->unset(name);
|
||||
@@ -138,7 +138,7 @@ void Qt4BuildEnvironmentWidget::switchEnvironmentTab(int newTab)
|
||||
{
|
||||
bool mergedEnvironments = (newTab == 0);
|
||||
m_environmentModel->setMergedEnvironments(mergedEnvironments);
|
||||
if(mergedEnvironments) {
|
||||
if (mergedEnvironments) {
|
||||
m_ui->removeButton->setText(tr("Reset"));
|
||||
} else {
|
||||
m_ui->removeButton->setText(tr("Remove"));
|
||||
@@ -153,8 +153,8 @@ void Qt4BuildEnvironmentWidget::updateButtonsEnabled()
|
||||
void Qt4BuildEnvironmentWidget::environmentCurrentIndexChanged(const QModelIndex ¤t, const QModelIndex &previous)
|
||||
{
|
||||
Q_UNUSED(previous)
|
||||
if(current.isValid()) {
|
||||
if(m_environmentModel->mergedEnvironments()) {
|
||||
if (current.isValid()) {
|
||||
if (m_environmentModel->mergedEnvironments()) {
|
||||
const QString &name = m_environmentModel->indexToVariable(current);
|
||||
bool modified = m_environmentModel->isInBaseEnvironment(name) && m_environmentModel->changes(name);
|
||||
bool unset = m_environmentModel->isUnset(name);
|
||||
|
||||
@@ -321,7 +321,7 @@ void Qt4PriFileNode::changeFiles(const FileType fileType,
|
||||
}
|
||||
|
||||
ProFile *includeFile = reader->proFileFor(m_projectFilePath);
|
||||
if(!includeFile) {
|
||||
if (!includeFile) {
|
||||
m_project->proFileParseError(tr("Error while changing pro file %1.").arg(m_projectFilePath));
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ void Qt4PriFileNode::save(ProFile *includeFile)
|
||||
Core::FileManager *fileManager = core->fileManager();
|
||||
QList<Core::IFile *> allFileHandles = fileManager->managedFiles(includeFile->fileName());
|
||||
Core::IFile *modifiedFileHandle = 0;
|
||||
foreach(Core::IFile *file, allFileHandles)
|
||||
foreach (Core::IFile *file, allFileHandles)
|
||||
if (file->fileName() == includeFile->fileName())
|
||||
modifiedFileHandle = file;
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ void Qt4Project::qtVersionsChanged()
|
||||
foreach (QString bc, buildConfigurations()) {
|
||||
if (!qt4ProjectManager()->versionManager()->version(qtVersionId(bc))->isValid()) {
|
||||
setQtVersion(bc, 0);
|
||||
if(bc == activeBuildConfiguration())
|
||||
if (bc == activeBuildConfiguration())
|
||||
update();
|
||||
}
|
||||
}
|
||||
@@ -663,7 +663,7 @@ QString Qt4Project::buildDirectory(const QString &buildConfiguration) const
|
||||
QString workingDirectory;
|
||||
if (value(buildConfiguration, "useShadowBuild").toBool())
|
||||
workingDirectory = value(buildConfiguration, "buildDirectory").toString();
|
||||
if(workingDirectory.isEmpty())
|
||||
if (workingDirectory.isEmpty())
|
||||
workingDirectory = QFileInfo(file()->fileName()).absolutePath();
|
||||
return workingDirectory;
|
||||
}
|
||||
@@ -698,7 +698,7 @@ int Qt4Project::qtVersionId(const QString &buildConfiguration) const
|
||||
qDebug()<<"Looking for qtVersion ID of "<<buildConfiguration;
|
||||
int id = 0;
|
||||
QVariant vid = value(buildConfiguration, "QtVersionId");
|
||||
if(vid.isValid()) {
|
||||
if (vid.isValid()) {
|
||||
id = vid.toInt();
|
||||
if (m_manager->versionManager()->version(id)->isValid()) {
|
||||
return id;
|
||||
@@ -711,10 +711,10 @@ int Qt4Project::qtVersionId(const QString &buildConfiguration) const
|
||||
QString vname = value(buildConfiguration, "QtVersion").toString();
|
||||
if (debug)
|
||||
qDebug()<<" Backward compatibility reading QtVersion"<<vname;
|
||||
if(!vname.isEmpty()) {
|
||||
if (!vname.isEmpty()) {
|
||||
const QList<QtVersion *> &versions = m_manager->versionManager()->versions();
|
||||
foreach (const QtVersion * const version, versions) {
|
||||
if(version->name() == vname) {
|
||||
if (version->name() == vname) {
|
||||
if (debug)
|
||||
qDebug()<<"found name in versions";
|
||||
const_cast<Qt4Project *>(this)->setValue(buildConfiguration, "QtVersionId", version->uniqueId());
|
||||
@@ -828,7 +828,7 @@ void Qt4Project::checkForDeletedApplicationProjects()
|
||||
|
||||
bool resetActiveRunConfiguration = false;
|
||||
QSharedPointer<RunConfiguration> rc(new ProjectExplorer::CustomExecutableRunConfiguration(this));
|
||||
foreach(QSharedPointer<Qt4RunConfiguration> qt4rc, removeList) {
|
||||
foreach (QSharedPointer<Qt4RunConfiguration> qt4rc, removeList) {
|
||||
removeRunConfiguration(qt4rc);
|
||||
if (activeRunConfiguration() == qt4rc)
|
||||
resetActiveRunConfiguration = true;
|
||||
@@ -905,7 +905,7 @@ bool Qt4Project::hasSubNode(Qt4PriFileNode *root, const QString &path)
|
||||
foreach (FolderNode *fn, root->subFolderNodes()) {
|
||||
if (qobject_cast<Qt4ProFileNode *>(fn)) {
|
||||
// we aren't interested in pro file nodes
|
||||
} else if(Qt4PriFileNode *qt4prifilenode = qobject_cast<Qt4PriFileNode *>(fn)) {
|
||||
} else if (Qt4PriFileNode *qt4prifilenode = qobject_cast<Qt4PriFileNode *>(fn)) {
|
||||
if (hasSubNode(qt4prifilenode, path))
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -102,9 +102,8 @@ void Qt4Manager::unregisterProject(Qt4Project *project)
|
||||
|
||||
void Qt4Manager::notifyChanged(const QString &name)
|
||||
{
|
||||
foreach(Qt4Project *pro, m_projects) {
|
||||
foreach (Qt4Project *pro, m_projects)
|
||||
pro->notifyChanged(name);
|
||||
}
|
||||
}
|
||||
|
||||
void Qt4Manager::init()
|
||||
|
||||
@@ -297,7 +297,7 @@ QString Qt4RunConfiguration::qmakeBuildConfigFromBuildConfiguration(const QStrin
|
||||
QStringList makeargs = ms->value(buildConfigurationName, "makeargs").toStringList();
|
||||
if (makeargs.contains("debug"))
|
||||
return "debug";
|
||||
else if(makeargs.contains("release"))
|
||||
else if (makeargs.contains("release"))
|
||||
return "release";
|
||||
|
||||
// Oh we don't have an explicit make argument
|
||||
@@ -428,7 +428,7 @@ QStringList Qt4RunConfigurationFactoryUser::canCreate(ProjectExplorer::Project *
|
||||
if (qt4project) {
|
||||
QStringList applicationProFiles;
|
||||
QList<Qt4ProFileNode *> list = qt4project->applicationProFiles();
|
||||
foreach(Qt4ProFileNode * node, list) {
|
||||
foreach (Qt4ProFileNode * node, list) {
|
||||
applicationProFiles.append("Qt4RunConfiguration." + node->path());
|
||||
}
|
||||
return applicationProFiles;
|
||||
|
||||
@@ -158,7 +158,7 @@ QWidget *QtVersionManager::createPage(QWidget *parent)
|
||||
void QtVersionManager::updateUniqueIdToIndexMap()
|
||||
{
|
||||
m_uniqueIdToIndex.clear();
|
||||
for(int i=0; i<m_versions.size(); ++i)
|
||||
for (int i = 0; i < m_versions.size(); ++i)
|
||||
m_uniqueIdToIndex.insert(m_versions.at(i)->uniqueId(), i);
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ QtVersion *QtVersionManager::version(int id) const
|
||||
if (pos != -1)
|
||||
return m_versions.at(pos);
|
||||
|
||||
if(m_defaultVersion < m_versions.count())
|
||||
if (m_defaultVersion < m_versions.count())
|
||||
return m_versions.at(m_defaultVersion);
|
||||
else
|
||||
return m_emptyVersion;
|
||||
@@ -248,17 +248,17 @@ void QtVersionManager::addNewVersionsFromInstaller()
|
||||
bool defaultVersionWasReset = false;
|
||||
foreach (QString newVersion, newVersionsList) {
|
||||
QStringList newVersionData = newVersion.split('=');
|
||||
if(newVersionData.count()>=2) {
|
||||
if (newVersionData.count()>=2) {
|
||||
if (QDir(newVersionData[1]).exists()) {
|
||||
QtVersion *version = new QtVersion(newVersionData[0], newVersionData[1], m_idcount++ );
|
||||
if(newVersionData.count() >= 3)
|
||||
if (newVersionData.count() >= 3)
|
||||
version->setMingwDirectory(newVersionData[2]);
|
||||
if(newVersionData.count() >= 4)
|
||||
if (newVersionData.count() >= 4)
|
||||
version->setPrependPath(newVersionData[3]);
|
||||
|
||||
bool versionWasAlreadyInList = false;
|
||||
foreach(const QtVersion * const it, m_versions) {
|
||||
if(QDir(version->path()).canonicalPath() == QDir(it->path()).canonicalPath()) {
|
||||
if (QDir(version->path()).canonicalPath() == QDir(it->path()).canonicalPath()) {
|
||||
versionWasAlreadyInList = true;
|
||||
break;
|
||||
}
|
||||
@@ -349,7 +349,7 @@ QString QtVersionManager::findSystemQt() const
|
||||
|
||||
QtVersion *QtVersionManager::currentQtVersion() const
|
||||
{
|
||||
if(m_defaultVersion < m_versions.count())
|
||||
if (m_defaultVersion < m_versions.count())
|
||||
return m_versions.at(m_defaultVersion);
|
||||
else
|
||||
return m_emptyVersion;
|
||||
@@ -465,27 +465,27 @@ void QtDirWidget::updateState()
|
||||
void QtDirWidget::showEnvironmentPage(QTreeWidgetItem *item)
|
||||
{
|
||||
m_ui.msvcComboBox->setVisible(false);
|
||||
if(item) {
|
||||
if (item) {
|
||||
int index = m_ui.qtdirList->indexOfTopLevelItem(item);
|
||||
m_ui.errorLabel->setText("");
|
||||
QtVersion::ToolchainType t = m_versions.at(index)->toolchainType();
|
||||
if(t == QtVersion::MinGW) {
|
||||
if (t == QtVersion::MinGW) {
|
||||
m_ui.msvcComboBox->setVisible(false);
|
||||
m_ui.msvcLabel->setVisible(false);
|
||||
m_ui.mingwLineEdit->setVisible(true);
|
||||
m_ui.mingwLabel->setVisible(true);
|
||||
m_ui.mingwBrowseButton->setVisible(true);
|
||||
m_ui.mingwLineEdit->setText(m_versions.at(index)->mingwDirectory());
|
||||
} else if(t == QtVersion::MSVC || t == QtVersion::WINCE){
|
||||
} else if (t == QtVersion::MSVC || t == QtVersion::WINCE){
|
||||
m_ui.msvcComboBox->setVisible(false);
|
||||
m_ui.msvcLabel->setVisible(true);
|
||||
m_ui.mingwLineEdit->setVisible(false);
|
||||
m_ui.mingwLabel->setVisible(false);
|
||||
m_ui.mingwBrowseButton->setVisible(false);
|
||||
QList<MSVCEnvironment> msvcenvironments = MSVCEnvironment::availableVersions();
|
||||
if(msvcenvironments.count() == 0) {
|
||||
if (msvcenvironments.count() == 0) {
|
||||
m_ui.msvcLabel->setText(tr("No Visual Studio Installation found"));
|
||||
} else if(msvcenvironments.count() == 1) {
|
||||
} else if (msvcenvironments.count() == 1) {
|
||||
m_ui.msvcLabel->setText( msvcenvironments.at(0).description());
|
||||
} else {
|
||||
m_ui.msvcComboBox->setVisible(true);
|
||||
@@ -500,7 +500,7 @@ void QtDirWidget::showEnvironmentPage(QTreeWidgetItem *item)
|
||||
}
|
||||
m_ui.msvcComboBox->blockSignals(block);
|
||||
}
|
||||
} else if(t == QtVersion::INVALID) {
|
||||
} else if (t == QtVersion::INVALID) {
|
||||
m_ui.msvcComboBox->setVisible(false);
|
||||
m_ui.msvcLabel->setVisible(false);
|
||||
m_ui.mingwLineEdit->setVisible(false);
|
||||
@@ -530,7 +530,7 @@ void QtDirWidget::showEnvironmentPage(QTreeWidgetItem *item)
|
||||
|
||||
void QtDirWidget::versionChanged(QTreeWidgetItem *item, QTreeWidgetItem *old)
|
||||
{
|
||||
if(old) {
|
||||
if (old) {
|
||||
fixQtVersionName(m_ui.qtdirList->indexOfTopLevelItem(old));
|
||||
}
|
||||
if (item) {
|
||||
@@ -601,7 +601,7 @@ void QtDirWidget::updateCurrentQtName()
|
||||
|
||||
void QtDirWidget::finish()
|
||||
{
|
||||
if(QTreeWidgetItem *item = m_ui.qtdirList->currentItem())
|
||||
if (QTreeWidgetItem *item = m_ui.qtdirList->currentItem())
|
||||
fixQtVersionName(m_ui.qtdirList->indexOfTopLevelItem(item));
|
||||
}
|
||||
|
||||
@@ -612,9 +612,9 @@ void QtDirWidget::finish()
|
||||
void QtDirWidget::fixQtVersionName(int index)
|
||||
{
|
||||
int count = m_versions.count();
|
||||
for(int i=0; i<count; ++i) {
|
||||
if(i != index) {
|
||||
if(m_versions.at(i)->name() == m_versions.at(index)->name()) {
|
||||
for (int i = 0; i < count; ++i) {
|
||||
if (i != index) {
|
||||
if (m_versions.at(i)->name() == m_versions.at(index)->name()) {
|
||||
// Same name, find new name
|
||||
QString name = m_versions.at(index)->name();
|
||||
QRegExp regexp("^(.*)\\((\\d)\\)$");
|
||||
@@ -666,7 +666,7 @@ void QtDirWidget::msvcVersionChanged()
|
||||
//get descriptionx
|
||||
QList<MSVCEnvironment> msvcEnvironments = MSVCEnvironment::availableVersions();
|
||||
foreach(const MSVCEnvironment &msvcEnv, msvcEnvironments) {
|
||||
if(msvcEnv.name() == msvcVersion) {
|
||||
if (msvcEnv.name() == msvcVersion) {
|
||||
m_ui.msvcLabel->setText(msvcEnv.description());
|
||||
break;
|
||||
}
|
||||
@@ -691,7 +691,7 @@ QtVersion::QtVersion(const QString &name, const QString &path, int id, bool isSy
|
||||
: m_name(name), m_isSystemVersion(isSystemVersion), m_notInstalled(false), m_defaultConfigIsDebug(true), m_defaultConfigIsDebugAndRelease(true)
|
||||
{
|
||||
setPath(path);
|
||||
if(id == -1)
|
||||
if (id == -1)
|
||||
m_id = getUniqueId();
|
||||
else
|
||||
m_id = id;
|
||||
@@ -860,7 +860,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q
|
||||
//Now chop into parts that are intresting
|
||||
QStringList parts;
|
||||
int lastpos = 0;
|
||||
for(int i=1; i<line.size(); ++i) {
|
||||
for (int i = 1; i < line.size(); ++i) {
|
||||
if (line.at(i) == QLatin1Char(' ') && line.at(i-1) != QLatin1Char('\\')) {
|
||||
// found a part
|
||||
parts.append(line.mid(lastpos, i-lastpos));
|
||||
@@ -874,7 +874,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q
|
||||
qDebug()<<"part appended:"<<line.mid(lastpos);
|
||||
|
||||
foreach(const QString &part, parts) {
|
||||
if(debugScan)
|
||||
if (debugScan)
|
||||
qDebug()<<"now interpreting part"<<part;
|
||||
bool setFlags;
|
||||
// Now try to understand each part for that we do a rather stupid approach, optimize it if you care
|
||||
@@ -893,7 +893,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q
|
||||
qDebug()<<"part has setFlags:"<<setFlags;
|
||||
// now loop forward, looking for something that looks like debug, release or debug_and_release
|
||||
|
||||
for(int i=0; i<part.size(); ++i) {
|
||||
for (int i = 0; i < part.size(); ++i) {
|
||||
int left = part.size() - i;
|
||||
if (left >= 17 && QStringRef(&part, i, 17) == "debug_and_release") {
|
||||
if (setFlags)
|
||||
@@ -910,7 +910,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q
|
||||
result = QtVersion::QmakeBuildConfig(result | QtVersion::DebugBuild);
|
||||
if (debugScan)
|
||||
qDebug()<<"found release new value"<<result;
|
||||
i +=7;
|
||||
i += 7;
|
||||
} else if (left >= 5 && QStringRef(&part, i, 5) == "debug") {
|
||||
if (setFlags)
|
||||
result = QtVersion::QmakeBuildConfig(result | QtVersion::DebugBuild);
|
||||
@@ -918,7 +918,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q
|
||||
result = QtVersion::QmakeBuildConfig(result & ~QtVersion::DebugBuild);
|
||||
if (debugScan)
|
||||
qDebug()<<"found debug new value"<<result;
|
||||
i+=5;
|
||||
i += 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1004,9 +1004,9 @@ void QtVersion::updateVersionInfo() const
|
||||
foreach(const QString &value, values) {
|
||||
if (value == "debug")
|
||||
m_defaultConfigIsDebug = true;
|
||||
else if(value == "release")
|
||||
else if (value == "release")
|
||||
m_defaultConfigIsDebug = false;
|
||||
else if(value == "build_all")
|
||||
else if (value == "build_all")
|
||||
m_defaultConfigIsDebugAndRelease = true;
|
||||
}
|
||||
}
|
||||
@@ -1031,11 +1031,11 @@ void QtVersion::updateMkSpec() const
|
||||
QString mkspec;
|
||||
// QFile f(path() + "/.qmake.cache");
|
||||
// if (f.exists() && f.open(QIODevice::ReadOnly)) {
|
||||
// while(!f.atEnd()) {
|
||||
// while (!f.atEnd()) {
|
||||
// QByteArray line = f.readLine();
|
||||
// if(line.startsWith("QMAKESPEC")) {
|
||||
// if (line.startsWith("QMAKESPEC")) {
|
||||
// const QList<QByteArray> &temp = line.split('=');
|
||||
// if(temp.size() == 2) {
|
||||
// if (temp.size() == 2) {
|
||||
// mkspec = temp.at(1).trimmed();
|
||||
// if (mkspec.startsWith("$$QT_BUILD_TREE/mkspecs/"))
|
||||
// mkspec = mkspec.mid(QString("$$QT_BUILD_TREE/mkspecs/").length());
|
||||
@@ -1058,9 +1058,9 @@ void QtVersion::updateMkSpec() const
|
||||
#ifdef Q_OS_WIN
|
||||
QFile f2(mkspecPath + "/qmake.conf");
|
||||
if (f2.exists() && f2.open(QIODevice::ReadOnly)) {
|
||||
while(!f2.atEnd()) {
|
||||
while (!f2.atEnd()) {
|
||||
QByteArray line = f2.readLine();
|
||||
if(line.startsWith("QMAKESPEC_ORIGINAL")) {
|
||||
if (line.startsWith("QMAKESPEC_ORIGINAL")) {
|
||||
const QList<QByteArray> &temp = line.split('=');
|
||||
if (temp.size() == 2) {
|
||||
mkspec = temp.at(1);
|
||||
@@ -1073,9 +1073,9 @@ void QtVersion::updateMkSpec() const
|
||||
#elif defined(Q_OS_MAC)
|
||||
QFile f2(mkspecPath + "/qmake.conf");
|
||||
if (f2.exists() && f2.open(QIODevice::ReadOnly)) {
|
||||
while(!f2.atEnd()) {
|
||||
while (!f2.atEnd()) {
|
||||
QByteArray line = f2.readLine();
|
||||
if(line.startsWith("MAKEFILE_GENERATOR")) {
|
||||
if (line.startsWith("MAKEFILE_GENERATOR")) {
|
||||
const QList<QByteArray> &temp = line.split('=');
|
||||
if (temp.size() == 2) {
|
||||
const QByteArray &value = temp.at(1);
|
||||
@@ -1106,7 +1106,7 @@ void QtVersion::updateMkSpec() const
|
||||
|
||||
m_mkspecFullPath = mkspec;
|
||||
int index = mkspec.lastIndexOf('/');
|
||||
if(index == -1)
|
||||
if (index == -1)
|
||||
index = mkspec.lastIndexOf('\\');
|
||||
QString mkspecDir = QDir(m_path + "/mkspecs/").canonicalPath();
|
||||
if (index >= 0 && QDir(mkspec.left(index)).canonicalPath() == mkspecDir)
|
||||
@@ -1123,7 +1123,7 @@ QString QtVersion::makeCommand() const
|
||||
const QString &spec = mkspec();
|
||||
if (spec.contains("win32-msvc") || spec.contains(QLatin1String("win32-icc")))
|
||||
return "nmake.exe";
|
||||
else if(spec.startsWith("wince"))
|
||||
else if (spec.startsWith("wince"))
|
||||
return "nmake.exe";
|
||||
else
|
||||
return "mingw32-make.exe";
|
||||
@@ -1140,7 +1140,7 @@ QString QtVersion::qmakeCommand() const
|
||||
return m_qmakeCommand;
|
||||
|
||||
QDir qtDir = path() + "/bin/";
|
||||
foreach(const QString &possibleCommand, QtVersionManager::possibleQMakeCommands()) {
|
||||
foreach (const QString &possibleCommand, QtVersionManager::possibleQMakeCommands()) {
|
||||
QString s = qtDir.absoluteFilePath(possibleCommand);
|
||||
QFileInfo qmake(s);
|
||||
if (qmake.exists() && qmake.isExecutable()) {
|
||||
@@ -1158,13 +1158,13 @@ QtVersion::ToolchainType QtVersion::toolchainType() const
|
||||
if (!isValid())
|
||||
return INVALID;
|
||||
const QString &spec = mkspec();
|
||||
if(spec.contains("win32-msvc") || spec.contains(QLatin1String("win32-icc")))
|
||||
if (spec.contains("win32-msvc") || spec.contains(QLatin1String("win32-icc")))
|
||||
return MSVC;
|
||||
else if(spec == "win32-g++")
|
||||
else if (spec == "win32-g++")
|
||||
return MinGW;
|
||||
else if(spec == QString::null)
|
||||
else if (spec == QString::null)
|
||||
return INVALID;
|
||||
else if(spec.startsWith("wince"))
|
||||
else if (spec.startsWith("wince"))
|
||||
return WINCE;
|
||||
else
|
||||
return OTHER;
|
||||
@@ -1210,32 +1210,32 @@ Environment QtVersion::addToEnvironment(const Environment &env)
|
||||
// or add Mingw dirs
|
||||
// or do nothing on other
|
||||
QtVersion::ToolchainType t = toolchainType();
|
||||
if(t == QtVersion::MinGW) {
|
||||
if (t == QtVersion::MinGW) {
|
||||
QFileInfo mingwFileInfo(m_mingwDirectory + "/bin");
|
||||
if(mingwFileInfo.exists())
|
||||
if (mingwFileInfo.exists())
|
||||
e.prependOrSetPath(m_mingwDirectory + "/bin");
|
||||
} else if(t == QtVersion::MSVC) {
|
||||
} else if (t == QtVersion::MSVC) {
|
||||
QList<MSVCEnvironment> list = MSVCEnvironment::availableVersions();
|
||||
if(list.count() == 1) {
|
||||
if (list.count() == 1) {
|
||||
e = list.at(0).addToEnvironment(e);
|
||||
} else {
|
||||
foreach(const MSVCEnvironment &m, list) {
|
||||
if(m.name() == m_msvcVersion) {
|
||||
if (m.name() == m_msvcVersion) {
|
||||
e = m.addToEnvironment(e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(t == QtVersion::WINCE) {
|
||||
} else if (t == QtVersion::WINCE) {
|
||||
QString msvcPath;
|
||||
// Find MSVC path
|
||||
QList<MSVCEnvironment> list = MSVCEnvironment::availableVersions();
|
||||
if(list.count() == 1) {
|
||||
if (list.count() == 1) {
|
||||
msvcPath = list.at(0).path();
|
||||
e = list.at(0).addToEnvironment(e);
|
||||
} else {
|
||||
foreach(const MSVCEnvironment &m, list) {
|
||||
if(m.name() == m_msvcVersion) {
|
||||
if (m.name() == m_msvcVersion) {
|
||||
e = m.addToEnvironment(e);
|
||||
msvcPath = m.path();
|
||||
break;
|
||||
@@ -1254,8 +1254,8 @@ Environment QtVersion::addToEnvironment(const Environment &env)
|
||||
CeSdkHandler cesdkhandler;
|
||||
cesdkhandler.parse(msvcPath);
|
||||
e = cesdkhandler.find(platformName).addToEnvironment(e);
|
||||
} else if(t == QtVersion::OTHER) {
|
||||
if(!m_prependPath.isEmpty())
|
||||
} else if (t == QtVersion::OTHER) {
|
||||
if (!m_prependPath.isEmpty())
|
||||
e.prependOrSetPath(m_prependPath);
|
||||
}
|
||||
return e;
|
||||
|
||||
@@ -93,7 +93,7 @@ static QString pluginDependencies(const PluginBaseClasses *plb)
|
||||
QString(QLatin1String(plb->dependentModules)).split(blank) :
|
||||
QStringList();
|
||||
pluginModules.push_back(QLatin1String(plb->module));
|
||||
foreach(const QString &module, pluginModules) {
|
||||
foreach (const QString &module, pluginModules) {
|
||||
if (!dependencies.isEmpty())
|
||||
dependencies += blank;
|
||||
dependencies += ModulesPage::idOfModule(module);
|
||||
|
||||
@@ -159,14 +159,12 @@ void ScriptEditor::contextMenuEvent(QContextMenuEvent *e)
|
||||
|
||||
if (Core::IActionContainer *mcontext = m_core->actionManager()->actionContainer(QtScriptEditor::Constants::M_CONTEXT)) {
|
||||
QMenu *contextMenu = mcontext->menu();
|
||||
foreach(QAction *action, contextMenu->actions()) {
|
||||
foreach (QAction *action, contextMenu->actions())
|
||||
menu->addAction(action);
|
||||
}
|
||||
}
|
||||
|
||||
menu->exec(e->globalPos());
|
||||
delete menu;
|
||||
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -243,7 +243,7 @@ void SnippetsWindow::showInputWidget(bool canceled, const QString &value)
|
||||
} else {
|
||||
QString desc = m_currentSnippet->argumentDescription(m_requiredArgs.first());
|
||||
QString def = m_currentSnippet->argumentDefault(m_requiredArgs.first());
|
||||
foreach(QString arg, m_args) {
|
||||
foreach (const QString &arg, m_args) {
|
||||
desc = desc.arg(arg);
|
||||
def = def.arg(arg);
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ SubversionPlugin::~SubversionPlugin()
|
||||
}
|
||||
|
||||
if (!m_editorFactories.empty()) {
|
||||
foreach(Core::IEditorFactory* pf, m_editorFactories)
|
||||
foreach (Core::IEditorFactory* pf, m_editorFactories)
|
||||
removeObject(pf);
|
||||
qDeleteAll(m_editorFactories);
|
||||
m_editorFactories.clear();
|
||||
@@ -579,9 +579,8 @@ void SubversionPlugin::revertCurrentFile()
|
||||
|
||||
Core::FileManager *fm = m_coreInstance->fileManager();
|
||||
QList<Core::IFile *> files = fm->managedFiles(file);
|
||||
foreach (Core::IFile *file, files) {
|
||||
foreach (Core::IFile *file, files)
|
||||
fm->blockFileChange(file);
|
||||
}
|
||||
|
||||
// revert
|
||||
args.clear();
|
||||
@@ -726,7 +725,7 @@ QStringList SubversionPlugin::parseStatusOutput(const QString &output) const
|
||||
QStringList changeSet;
|
||||
const QString newLine = QString(QLatin1Char('\n'));
|
||||
const QStringList list = output.split(newLine, QString::SkipEmptyParts);
|
||||
foreach (const QString& l, list) {
|
||||
foreach (const QString &l, list) {
|
||||
QString line(l.trimmed());
|
||||
if (line.startsWith(QLatin1Char('A')) || line.startsWith(QLatin1Char('D'))
|
||||
|| line.startsWith(QLatin1Char('M')))
|
||||
|
||||
@@ -60,9 +60,8 @@ void BaseTextMark::init()
|
||||
Core::EditorManager *em = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()->editorManager();
|
||||
connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *)));
|
||||
|
||||
foreach(Core::IEditor *editor, em->openedEditors()) {
|
||||
foreach (Core::IEditor *editor, em->openedEditors())
|
||||
editorOpened(editor);
|
||||
}
|
||||
}
|
||||
|
||||
void BaseTextMark::editorOpened(Core::IEditor *editor)
|
||||
@@ -132,7 +131,6 @@ void BaseTextMark::moveMark(const QString & /* filename */, int /* line */)
|
||||
delete m_internalMark;
|
||||
m_internalMark = 0;
|
||||
|
||||
foreach(Core::IEditor *editor, em->openedEditors()) {
|
||||
foreach (Core::IEditor *editor, em->openedEditors())
|
||||
editorOpened(editor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,15 +87,15 @@ CodecSelector::CodecSelector(QWidget *parent, BaseTextDocument *doc)
|
||||
QList<int> mibs = QTextCodec::availableMibs();
|
||||
qSort(mibs);
|
||||
QList<int> sortedMibs;
|
||||
foreach(int mib, mibs)
|
||||
foreach (int mib, mibs)
|
||||
if (mib >= 0)
|
||||
sortedMibs += mib;
|
||||
foreach(int mib, mibs)
|
||||
foreach (int mib, mibs)
|
||||
if (mib < 0)
|
||||
sortedMibs += mib;
|
||||
|
||||
int currentIndex = -1;
|
||||
foreach(int mib, sortedMibs) {
|
||||
foreach (int mib, sortedMibs) {
|
||||
QTextCodec *c = QTextCodec::codecForMib(mib);
|
||||
if (!buf.isEmpty()) {
|
||||
|
||||
@@ -109,9 +109,8 @@ CodecSelector::CodecSelector(QWidget *parent, BaseTextDocument *doc)
|
||||
continue;
|
||||
}
|
||||
QString names = QString::fromLatin1(c->name());
|
||||
foreach(QByteArray alias, c->aliases()) {
|
||||
foreach (QByteArray alias, c->aliases())
|
||||
names += QLatin1String(" / ") + QString::fromLatin1(alias);
|
||||
}
|
||||
if (doc->codec() == c)
|
||||
currentIndex = encodings.count();
|
||||
encodings << names;
|
||||
|
||||
Reference in New Issue
Block a user