some file cosmetics (mostly #include order and whitespace)

This commit is contained in:
hjk
2008-12-02 12:57:59 +01:00
parent e2fb40c763
commit 1472bdb0cc
52 changed files with 213 additions and 206 deletions

View File

@@ -30,9 +30,11 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include <QtGui/QApplication>
#include "textfinder.h" #include "textfinder.h"
#include <QtGui/QApplication>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(textfinder); Q_INIT_RESOURCE(textfinder);

View File

@@ -30,10 +30,12 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include <QtGui/QMessageBox>
#include "textfinder.h"
#include <QtCore/QFile> #include <QtCore/QFile>
#include <QtCore/QTextStream> #include <QtCore/QTextStream>
#include "textfinder.h" #include <QtGui/QMessageBox>
TextFinder::TextFinder(QWidget *parent, Qt::WFlags flags) TextFinder::TextFinder(QWidget *parent, Qt::WFlags flags)
: QWidget(parent, flags) : QWidget(parent, flags)

View File

@@ -30,12 +30,14 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef TEXTFINDER_H #ifndef TEXTFINDER_H
#define TEXTFINDER_H #define TEXTFINDER_H
#include <QtGui/QWidget>
#include "ui_textfinder.h" #include "ui_textfinder.h"
#include <QtGui/QWidget>
class QPushButton; class QPushButton;
class QTextEdit; class QTextEdit;
class QLineEdit; class QLineEdit;

View File

@@ -30,13 +30,14 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include "cgi.h" #include "cgi.h"
#include <QByteArray> #include <QByteArray>
// -------------------------------------------------------------------------------------------------
const char *cgi_chars = "0123456789abcdef"; // RFC 1738 suggests lower-case to be optimal const char *cgi_chars = "0123456789abcdef"; // RFC 1738 suggests lower-case to be optimal
QString CGI::encodeURL(const QString &rawText) QString CGI::encodeURL(const QString &rawText)
{ {
QByteArray utf = rawText.toUtf8(); QByteArray utf = rawText.toUtf8();
@@ -424,5 +425,3 @@ QString CGI::encodeHTML(const QString &rawText, int conversionFlags)
return enc; return enc;
} }
// -------------------------------------------------------------------------------------------------

View File

@@ -30,8 +30,10 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef _CGI_H_
#define _CGI_H_ #ifndef CGI_H
#define CGI_H
#include <QString> #include <QString>
class CGI class CGI
@@ -54,5 +56,4 @@ private:
inline QChar hexToChar(const QString &hx); inline QChar hexToChar(const QString &hx);
}; };
#endif // _CGI_H_ #endif // CGI_H

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include "fetcher.h" #include "fetcher.h"
#include "cgi.h" #include "cgi.h"
@@ -44,7 +45,7 @@ Fetcher::Fetcher(const QString &host)
m_status = 0; m_status = 0;
m_hadError = false; m_hadError = false;
connect(this, SIGNAL(requestFinished(int,bool)), SLOT(gotRequestFinished(int,bool))); connect(this, SIGNAL(requestFinished(int,bool)), SLOT(gotRequestFinished(int,bool)));
connect(this, SIGNAL(readyRead(const QHttpResponseHeader &)), SLOT(gotReadyRead(const QHttpResponseHeader &))); connect(this, SIGNAL(readyRead(QHttpResponseHeader)), SLOT(gotReadyRead(QHttpResponseHeader)));
} }
int Fetcher::fetch(const QString &url) int Fetcher::fetch(const QString &url)

View File

@@ -30,12 +30,12 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef FETCHER_H #ifndef FETCHER_H
#define FETCHER_H #define FETCHER_H
#include <QHttp> #include <QHttp>
#include <QHttpResponseHeader> #include <QHttpResponseHeader>
#include <QString> #include <QString>
class Fetcher : public QHttp class Fetcher : public QHttp

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include "poster.h" #include "poster.h"
#include "cgi.h" #include "cgi.h"
@@ -43,7 +44,7 @@ Poster::Poster(const QString &host)
m_status = 0; m_status = 0;
m_hadError = false; m_hadError = false;
connect(this, SIGNAL(requestFinished(int,bool)), SLOT(gotRequestFinished(int,bool))); connect(this, SIGNAL(requestFinished(int,bool)), SLOT(gotRequestFinished(int,bool)));
connect(this, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)), SLOT(gotResponseHeaderReceived(const QHttpResponseHeader &))); connect(this, SIGNAL(responseHeaderReceived(QHttpResponseHeader)), SLOT(gotResponseHeaderReceived(QHttpResponseHeader)));
} }
void Poster::post(const QString &description, const QString &comment, void Poster::post(const QString &description, const QString &comment,

View File

@@ -30,12 +30,12 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef POSTER_H #ifndef POSTER_H
#define POSTER_H #define POSTER_H
#include <QHttp> #include <QHttp>
#include <QHttpResponseHeader> #include <QHttpResponseHeader>
#include <QString> #include <QString>
class Poster : public QHttp class Poster : public QHttp

View File

@@ -30,7 +30,9 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include "splitter.h" #include "splitter.h"
#include <QRegExp> #include <QRegExp>
FileDataList splitDiffToFiles(const QByteArray &data) FileDataList splitDiffToFiles(const QByteArray &data)

View File

@@ -30,12 +30,13 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef SPLITTER_H #ifndef SPLITTER_H
#define SPLITTER_H #define SPLITTER_H
#include <QString>
#include <QByteArray> #include <QByteArray>
#include <QList> #include <QList>
#include <QString>
struct FileData struct FileData
{ {

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include "view.h" #include "view.h"
#include <QFontMetrics> #include <QFontMetrics>
@@ -38,7 +39,6 @@
#include <QPushButton> #include <QPushButton>
#include <QSettings> #include <QSettings>
// -------------------------------------------------------------------------------------------------
class ColumnIndicatorTextEdit : public QTextEdit class ColumnIndicatorTextEdit : public QTextEdit
{ {
public: public:

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef VIEW_H #ifndef VIEW_H
#define VIEW_H #define VIEW_H
@@ -63,4 +64,3 @@ private:
}; };
#endif // VIEW_H #endif // VIEW_H

View File

@@ -30,24 +30,5 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
// Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "Array.h" #include "Array.h"

View File

@@ -30,24 +30,5 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
// Copyright (c) 2008 Roberto Raggi <roberto.raggi@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "LiteralTable.h" #include "LiteralTable.h"

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include "widgethost.h" #include "widgethost.h"
#include "formresizer.h" #include "formresizer.h"
#include "widgethostconstants.h" #include "widgethostconstants.h"

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef WIDGETHOST_H #ifndef WIDGETHOST_H
#define WIDGETHOST_H #define WIDGETHOST_H
@@ -80,4 +81,3 @@ private:
} // namespace SharedTools } // namespace SharedTools
#endif // WIDGETHOST_H #endif // WIDGETHOST_H

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef WIDGETHOST_CONSTANTS_H #ifndef WIDGETHOST_CONSTANTS_H
#define WIDGETHOST_CONSTANTS_H #define WIDGETHOST_CONSTANTS_H
@@ -40,5 +41,5 @@ namespace SharedTools {
} }
} }
#endif //WIDGETHOST_CONSTANTS_H #endif // WIDGETHOST_CONSTANTS_H

View File

@@ -108,7 +108,7 @@ void ContentWindow::keyPressEvent(QKeyEvent *e)
emit escapePressed(); emit escapePressed();
} }
bool ContentWindow::eventFilter(QObject* o, QEvent *e) bool ContentWindow::eventFilter(QObject *o, QEvent *e)
{ {
if (m_contentWidget && o == m_contentWidget->viewport() && e->type() if (m_contentWidget && o == m_contentWidget->viewport() && e->type()
== QEvent::MouseButtonRelease) { == QEvent::MouseButtonRelease) {

View File

@@ -66,7 +66,7 @@ private slots:
private: private:
void focusInEvent(QFocusEvent *e); void focusInEvent(QFocusEvent *e);
void keyPressEvent(QKeyEvent *e); void keyPressEvent(QKeyEvent *e);
bool eventFilter(QObject* o, QEvent *e); bool eventFilter(QObject *o, QEvent *e);
QHelpEngine *m_helpEngine; QHelpEngine *m_helpEngine;
QHelpContentWidget *m_contentWidget; QHelpContentWidget *m_contentWidget;
@@ -75,4 +75,4 @@ private:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif #endif // CONTENTWINDOW_H

View File

@@ -45,7 +45,7 @@ FilterNameDialog::FilterNameDialog(QWidget *parent)
SIGNAL(clicked()), this, SLOT(accept())); SIGNAL(clicked()), this, SLOT(accept()));
connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel),
SIGNAL(clicked()), this, SLOT(reject())); SIGNAL(clicked()), this, SLOT(reject()));
connect(m_ui.lineEdit, SIGNAL(textChanged(const QString&)), connect(m_ui.lineEdit, SIGNAL(textChanged(QString)),
this, SLOT(updateOkButton())); this, SLOT(updateOkButton()));
m_ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(true); m_ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(true);

View File

@@ -214,8 +214,8 @@ HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent)
connect(pageAction(QWebPage::Copy), SIGNAL(changed()), this, SLOT(actionChanged())); connect(pageAction(QWebPage::Copy), SIGNAL(changed()), this, SLOT(actionChanged()));
connect(pageAction(QWebPage::Back), SIGNAL(changed()), this, SLOT(actionChanged())); connect(pageAction(QWebPage::Back), SIGNAL(changed()), this, SLOT(actionChanged()));
connect(pageAction(QWebPage::Forward), SIGNAL(changed()), this, SLOT(actionChanged())); connect(pageAction(QWebPage::Forward), SIGNAL(changed()), this, SLOT(actionChanged()));
connect(page(), SIGNAL(linkHovered(const QString &, const QString &, const QString &)), this, SIGNAL(highlighted(const QString &))); connect(page(), SIGNAL(linkHovered(QString, QString, QString)), this, SIGNAL(highlighted(QString)));
connect(this, SIGNAL(urlChanged(const QUrl &)), this, SIGNAL(sourceChanged(const QUrl &))); connect(this, SIGNAL(urlChanged(QUrl)), this, SIGNAL(sourceChanged(QUrl)));
} }
void HelpViewer::setSource(const QUrl &url) void HelpViewer::setSource(const QUrl &url)

View File

@@ -60,8 +60,8 @@ IndexWindow::IndexWindow(QHelpEngine *helpEngine, QWidget *parent)
m_searchLineEdit = new QLineEdit(); m_searchLineEdit = new QLineEdit();
l->setBuddy(m_searchLineEdit); l->setBuddy(m_searchLineEdit);
connect(m_searchLineEdit, SIGNAL(textChanged(const QString&)), connect(m_searchLineEdit, SIGNAL(textChanged(QString)),
this, SLOT(filterIndices(const QString&))); this, SLOT(filterIndices(QString)));
m_searchLineEdit->installEventFilter(this); m_searchLineEdit->installEventFilter(this);
layout->setMargin(4); layout->setMargin(4);
layout->addWidget(m_searchLineEdit); layout->addWidget(m_searchLineEdit);
@@ -72,11 +72,10 @@ IndexWindow::IndexWindow(QHelpEngine *helpEngine, QWidget *parent)
this, SLOT(disableSearchLineEdit())); this, SLOT(disableSearchLineEdit()));
connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()), connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()),
this, SLOT(enableSearchLineEdit())); this, SLOT(enableSearchLineEdit()));
connect(m_indexWidget, SIGNAL(linkActivated(const QUrl&, const QString&)), connect(m_indexWidget, SIGNAL(linkActivated(QUrl, QString)),
this, SIGNAL(linkActivated(const QUrl&))); this, SIGNAL(linkActivated(QUrl)));
connect(m_indexWidget, SIGNAL(linksActivated(const QMap<QString, QUrl>&, connect(m_indexWidget, SIGNAL(linksActivated(QMap<QString, QUrl>, QString)),
const QString&)), this, SIGNAL(linksActivated(const QMap<QString, QUrl>&, this, SIGNAL(linksActivated(QMap<QString, QUrl>, QString)));
const QString&)));
connect(m_searchLineEdit, SIGNAL(returnPressed()), connect(m_searchLineEdit, SIGNAL(returnPressed()),
m_indexWidget, SLOT(activateCurrentItem())); m_indexWidget, SLOT(activateCurrentItem()));
layout->addWidget(m_indexWidget); layout->addWidget(m_indexWidget);

View File

@@ -31,8 +31,8 @@
** **
***************************************************************************/ ***************************************************************************/
#ifndef INDEXWINDOW #ifndef INDEXWINDOW_H
#define INDEXWINDOW #define INDEXWINDOW_H
#include <QtCore/QUrl> #include <QtCore/QUrl>
#include <QtGui/QWidget> #include <QtGui/QWidget>
@@ -75,4 +75,4 @@ private:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif #endif // INDEXWINDOW_H

View File

@@ -34,12 +34,13 @@
#ifndef TOPICCHOOSER_H #ifndef TOPICCHOOSER_H
#define TOPICCHOOSER_H #define TOPICCHOOSER_H
#include "ui_topicchooser.h"
#include <QUrl> #include <QUrl>
#include <QMap> #include <QMap>
#include <QString> #include <QString>
#include <QtGui/QDialog> #include <QtGui/QDialog>
#include "ui_topicchooser.h"
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@@ -60,4 +61,4 @@ private:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif #endif // TOPICCHOOSER_H

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include "indenter.h" #include "indenter.h"
using namespace SharedTools::IndenterInternal; using namespace SharedTools::IndenterInternal;

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef INDENTER_H #ifndef INDENTER_H
#define INDENTER_H #define INDENTER_H
@@ -141,4 +142,4 @@ private:
#include "indenter_impl.h" #include "indenter_impl.h"
#endif #endif // INDENTER_H

View File

@@ -30,22 +30,10 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef INDENTER_C #ifndef INDENTER_C
#define INDENTER_C #define INDENTER_C
/****************************************************************************
**
** Copyright (C) 1992-$THISYEAR$ Trolltech AS. All rights reserved.
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
** $LICENSE$
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/
/* /*
This file is a self-contained interactive indenter for C++ and Qt This file is a self-contained interactive indenter for C++ and Qt
Script. Script.
@@ -1120,4 +1108,5 @@ int Indenter<Iterator>::indentForBottomLine(const Iterator &current,
#undef YY_SAVE #undef YY_SAVE
#undef YY_RESTORE #undef YY_RESTORE
#endif
#endif // INDENTER_C

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include "indenter.h" #include "indenter.h"
#include <QtCore/QFile> #include <QtCore/QFile>
@@ -40,12 +41,12 @@
#include <stdio.h> #include <stdio.h>
typedef SharedTools::Indenter<QStringList::const_iterator> Indenter ; typedef SharedTools::Indenter<QStringList::const_iterator> Indenter;
static QString fileContents( const QString& fileName ) static QString fileContents(const QString &fileName)
{ {
QFile f( fileName ); QFile f(fileName);
if ( !f.open(QIODevice::ReadOnly) ) { if (!f.open(QIODevice::ReadOnly)) {
const QString msg = QString(QLatin1String("error: Cannot open file '%1' for reading: %2")). const QString msg = QString(QLatin1String("error: Cannot open file '%1' for reading: %2")).
arg(fileName).arg(f.errorString()); arg(fileName).arg(f.errorString());
qWarning(msg.toLatin1().constData()); qWarning(msg.toLatin1().constData());
@@ -119,11 +120,11 @@ static QStringList parseCommandLine(char **begin, char **end)
int format(const QString &fileName) int format(const QString &fileName)
{ {
const QString code = fileContents(fileName ); const QString code = fileContents(fileName);
if ( code == QString::null) if (code == QString::null)
return 1; return 1;
QStringList program = code.split( QLatin1Char('\n'), QString::KeepEmptyParts); QStringList program = code.split(QLatin1Char('\n'), QString::KeepEmptyParts);
while (!program.isEmpty()) { while (!program.isEmpty()) {
if (!program.back().trimmed().isEmpty()) if (!program.back().trimmed().isEmpty())
break; break;
@@ -143,14 +144,14 @@ int format(const QString &fileName)
QString &line = p.back(); QString &line = p.back();
QChar typedIn = Indenter::instance().firstNonWhiteSpace(line); QChar typedIn = Indenter::instance().firstNonWhiteSpace(line);
if ( p.last().endsWith( colon ) ) if (p.last().endsWith(colon))
typedIn = colon; typedIn = colon;
const int indent = Indenter::instance().indentForBottomLine( p.constBegin(), p.constEnd(), typedIn ); const int indent = Indenter::instance().indentForBottomLine(p.constBegin(), p.constEnd(), typedIn);
const QString trimmed = line.trimmed(); const QString trimmed = line.trimmed();
// Indent the line in the list so that the formatter code sees the indented line. // Indent the line in the list so that the formatter code sees the indented line.
if ( !trimmed.isEmpty() ) { if (!trimmed.isEmpty()) {
line = QString(indent, blank); line = QString(indent, blank);
line += trimmed; line += trimmed;
} }
@@ -158,14 +159,14 @@ int format(const QString &fileName)
out += newLine ; out += newLine ;
} }
while ( out.endsWith(newLine) ) while (out.endsWith(newLine))
out.truncate( out.length() - 1 ); out.truncate(out.length() - 1 );
fputs(out.toUtf8().constData(), stdout); fputs(out.toUtf8().constData(), stdout);
return 0; return 0;
} }
int main( int argc, char **argv ) int main(int argc, char **argv)
{ {
const QStringList fileNames = parseCommandLine(argv, argv + argc); const QStringList fileNames = parseCommandLine(argv, argv + argc);
if (fileNames.empty()) { if (fileNames.empty()) {

View File

@@ -49,4 +49,4 @@
# define QT_MANGLE_NAMESPACE(name) name # define QT_MANGLE_NAMESPACE(name) name
#endif #endif
#endif #endif // NAMESPACE_GLOBAL_H

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef ABSTRACTPROITEMVISITOR #ifndef ABSTRACTPROITEMVISITOR
#define ABSTRACTPROITEMVISITOR #define ABSTRACTPROITEMVISITOR
@@ -37,7 +38,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
struct AbstractProItemVisitor { struct AbstractProItemVisitor
{
virtual ~AbstractProItemVisitor() {} virtual ~AbstractProItemVisitor() {}
virtual bool visitBeginProBlock(ProBlock *block) = 0; virtual bool visitBeginProBlock(ProBlock *block) = 0;
virtual bool visitEndProBlock(ProBlock *block) = 0; virtual bool visitEndProBlock(ProBlock *block) = 0;
@@ -52,7 +54,6 @@ struct AbstractProItemVisitor {
virtual bool visitProFunction(ProFunction *function) = 0; virtual bool visitProFunction(ProFunction *function) = 0;
virtual bool visitProOperator(ProOperator *function) = 0; virtual bool visitProOperator(ProOperator *function) = 0;
virtual bool visitProCondition(ProCondition *function) = 0; virtual bool visitProCondition(ProCondition *function) = 0;
}; };
QT_END_NAMESPACE QT_END_NAMESPACE

View File

@@ -30,12 +30,14 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include "procommandmanager.h" #include "procommandmanager.h"
using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager::Internal;
ProCommandGroup::ProCommandGroup(const QString &name) ProCommandGroup::ProCommandGroup(const QString &name)
: m_name(name) { } : m_name(name)
{ }
ProCommandGroup::~ProCommandGroup() ProCommandGroup::~ProCommandGroup()
{ {
@@ -49,16 +51,14 @@ void ProCommandGroup::appendCommand(ProCommand *cmd)
void ProCommandGroup::undo() void ProCommandGroup::undo()
{ {
for(int i=m_commands.count(); i>0; --i) { for (int i = m_commands.count(); i > 0; --i)
m_commands[i-1]->undo(); m_commands[i-1]->undo();
}
} }
void ProCommandGroup::redo() void ProCommandGroup::redo()
{ {
for(int i=0; i<m_commands.count(); ++i) { for (int i = 0; i < m_commands.count(); ++i)
m_commands[i]->redo(); m_commands[i]->redo();
}
} }
ProCommandManager::ProCommandManager(QObject *parent) ProCommandManager::ProCommandManager(QObject *parent)
@@ -80,9 +80,8 @@ void ProCommandManager::beginGroup(const QString &name)
if (m_pos != m_groups.count()) { if (m_pos != m_groups.count()) {
int removecount = m_groups.count() - m_pos; int removecount = m_groups.count() - m_pos;
for(int i=0; i<removecount; ++i) { for (int i = 0; i < removecount; ++i)
delete m_groups.takeLast(); delete m_groups.takeLast();
}
m_pos = m_groups.count(); m_pos = m_groups.count();
} }
@@ -91,7 +90,7 @@ void ProCommandManager::beginGroup(const QString &name)
bool ProCommandManager::hasGroup() const bool ProCommandManager::hasGroup() const
{ {
return (m_group != 0); return m_group != 0;
} }
void ProCommandManager::endGroup() void ProCommandManager::endGroup()
@@ -154,13 +153,12 @@ void ProCommandManager::notifySave()
m_savepoint = m_groups.at(m_pos - 1); m_savepoint = m_groups.at(m_pos - 1);
} }
bool ProCommandManager::canUndo() const bool ProCommandManager::canUndo() const
{ {
return (!m_groups.isEmpty() && m_pos > 0); return !m_groups.isEmpty() && m_pos > 0;
} }
bool ProCommandManager::canRedo() const bool ProCommandManager::canRedo() const
{ {
return (m_groups.count() > m_pos); return m_groups.count() > m_pos;
} }

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef PROCOMMANDMANAGER_H #ifndef PROCOMMANDMANAGER_H
#define PROCOMMANDMANAGER_H #define PROCOMMANDMANAGER_H
@@ -37,19 +38,23 @@
#include <QtCore/QModelIndex> #include <QtCore/QModelIndex>
QT_FORWARD_DECLARE_CLASS(ProItem) QT_BEGIN_NAMESPACE
class ProItem;
QT_END_NAMESPACE
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
class ProCommand { class ProCommand
{
public: public:
virtual ~ProCommand() {} virtual ~ProCommand() {}
virtual bool redo() = 0; virtual bool redo() = 0;
virtual void undo() = 0; virtual void undo() = 0;
}; };
class ProCommandGroup { class ProCommandGroup
{
public: public:
ProCommandGroup(const QString &name); ProCommandGroup(const QString &name);
~ProCommandGroup(); ~ProCommandGroup();
@@ -104,4 +109,4 @@ private:
} //namespace Internal } //namespace Internal
} //namespace Qt4ProjectManager } //namespace Qt4ProjectManager
#endif //PROCOMMANDMANAGER_H #endif // PROCOMMANDMANAGER_H

View File

@@ -30,9 +30,6 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include <QtGui/QMenu>
#include <QtGui/QKeyEvent>
#include <QtGui/QClipboard>
#include "proeditor.h" #include "proeditor.h"
#include "proitems.h" #include "proitems.h"
@@ -40,6 +37,10 @@
#include "procommandmanager.h" #include "procommandmanager.h"
#include "proxml.h" #include "proxml.h"
#include <QtGui/QMenu>
#include <QtGui/QKeyEvent>
#include <QtGui/QClipboard>
using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager::Internal;
ProEditor::ProEditor(QWidget *parent, bool shortcuts) ProEditor::ProEditor(QWidget *parent, bool shortcuts)
@@ -58,7 +59,6 @@ ProEditor::ProEditor(QWidget *parent, bool shortcuts)
ProEditor::~ProEditor() ProEditor::~ProEditor()
{ {
} }
void ProEditor::initialize(ProEditorModel *model, ProItemInfoManager *infomanager) void ProEditor::initialize(ProEditorModel *model, ProItemInfoManager *infomanager)
@@ -384,4 +384,3 @@ void ProEditor::addBlock()
m_editListView->setCurrentIndex(m_model->index(row,0,parent)); m_editListView->setCurrentIndex(m_model->index(row,0,parent));
} }
} }

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef PROEDITOR_H #ifndef PROEDITOR_H
#define PROEDITOR_H #define PROEDITOR_H
@@ -56,8 +57,7 @@ namespace Internal {
class ProEditorModel; class ProEditorModel;
class ProScopeFilter; class ProScopeFilter;
class ProEditor : public QWidget, class ProEditor : public QWidget, protected Ui::ProEditor
protected Ui::ProEditor
{ {
Q_OBJECT Q_OBJECT
@@ -125,4 +125,4 @@ private:
} //namespace Internal } //namespace Internal
} //namespace Qt4ProjectManager } //namespace Qt4ProjectManager
#endif //PROEDITOR_H #endif // PROEDITOR_H

View File

@@ -30,10 +30,6 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include <QtCore/QStringList>
#include <QtCore/QMimeData>
#include <QtCore/QDebug>
#include <QtGui/QIcon>
#include "proxml.h" #include "proxml.h"
#include "proitems.h" #include "proitems.h"
@@ -41,12 +37,18 @@
#include "procommandmanager.h" #include "procommandmanager.h"
#include "proiteminfo.h" #include "proiteminfo.h"
#include <QtCore/QDebug>
#include <QtCore/QMimeData>
#include <QtCore/QStringList>
#include <QtGui/QIcon>
using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager::Internal;
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
class ProAddCommand : public ProCommand { class ProAddCommand : public ProCommand
{
public: public:
ProAddCommand(ProEditorModel *model, ProItem *item, int row, const QModelIndex &parent, bool dodelete = true) ProAddCommand(ProEditorModel *model, ProItem *item, int row, const QModelIndex &parent, bool dodelete = true)
: m_model(model), m_item(item), m_row(row), m_parent(parent), m_dodelete(dodelete), m_delete(false) { } : m_model(model), m_item(item), m_row(row), m_parent(parent), m_dodelete(dodelete), m_delete(false) { }
@@ -75,7 +77,8 @@ private:
bool m_delete; bool m_delete;
}; };
class ProRemoveCommand : public ProCommand { class ProRemoveCommand : public ProCommand
{
public: public:
ProRemoveCommand(ProEditorModel *model, const QModelIndex &index, bool dodelete = true) ProRemoveCommand(ProEditorModel *model, const QModelIndex &index, bool dodelete = true)
: m_model(model), m_index(index), m_dodelete(dodelete), m_delete(dodelete) { } : m_model(model), m_index(index), m_dodelete(dodelete), m_delete(dodelete) { }
@@ -103,7 +106,8 @@ private:
bool m_delete; bool m_delete;
}; };
class ChangeProVariableIdCommand : public ProCommand { class ChangeProVariableIdCommand : public ProCommand
{
public: public:
ChangeProVariableIdCommand(ProEditorModel *model, ProVariable *variable, const QString &newId) ChangeProVariableIdCommand(ProEditorModel *model, ProVariable *variable, const QString &newId)
: m_newId(newId), m_model(model), m_variable(variable) : m_newId(newId), m_model(model), m_variable(variable)
@@ -130,7 +134,8 @@ private:
ProVariable *m_variable; ProVariable *m_variable;
}; };
class ChangeProVariableOpCommand : public ProCommand { class ChangeProVariableOpCommand : public ProCommand
{
public: public:
ChangeProVariableOpCommand(ProEditorModel *model, ProVariable *variable, ProVariable::VariableOperator newOp) ChangeProVariableOpCommand(ProEditorModel *model, ProVariable *variable, ProVariable::VariableOperator newOp)
: m_newOp(newOp), m_model(model), m_variable(variable) : m_newOp(newOp), m_model(model), m_variable(variable)
@@ -157,7 +162,8 @@ private:
ProVariable *m_variable; ProVariable *m_variable;
}; };
class ChangeProScopeCommand : public ProCommand { class ChangeProScopeCommand : public ProCommand
{
public: public:
ChangeProScopeCommand(ProEditorModel *model, ProBlock *scope, const QString &newExp) ChangeProScopeCommand(ProEditorModel *model, ProBlock *scope, const QString &newExp)
: m_newExp(newExp), m_model(model), m_scope(scope) { : m_newExp(newExp), m_model(model), m_scope(scope) {
@@ -196,7 +202,8 @@ private:
ProBlock *m_scope; ProBlock *m_scope;
}; };
class ChangeProAdvancedCommand : public ProCommand { class ChangeProAdvancedCommand : public ProCommand
{
public: public:
ChangeProAdvancedCommand(ProEditorModel *model, ProBlock *block, const QString &newExp) ChangeProAdvancedCommand(ProEditorModel *model, ProBlock *block, const QString &newExp)
: m_newExp(newExp), m_model(model), m_block(block) { : m_newExp(newExp), m_model(model), m_block(block) {
@@ -239,7 +246,6 @@ ProEditorModel::ProEditorModel(QObject *parent)
ProEditorModel::~ProEditorModel() ProEditorModel::~ProEditorModel()
{ {
} }
void ProEditorModel::setInfoManager(ProItemInfoManager *infomanager) void ProEditorModel::setInfoManager(ProItemInfoManager *infomanager)
@@ -299,9 +305,8 @@ QList<QModelIndex> ProEditorModel::findBlocks(const QModelIndex &parent) const
return result; return result;
} }
for (int i=0; i<rowCount(parent); ++i) { for (int i = 0; i < rowCount(parent); ++i)
result += findBlocks(index(i, 0, parent)); result += findBlocks(index(i, 0, parent));
}
return result; return result;
} }
@@ -936,7 +941,8 @@ bool ProScopeFilter::setData(const QModelIndex &index, const QVariant &value, in
{ {
// map to source // map to source
if (m_checkable != ProScopeFilter::None && role == Qt::CheckStateRole) { if (m_checkable != ProScopeFilter::None && role == Qt::CheckStateRole) {
if ( m_checkable == ProScopeFilter::Blocks || ( m_checkable == ProScopeFilter::Variable && sourceVariable(index))) { if (m_checkable == ProScopeFilter::Blocks
|| (m_checkable == ProScopeFilter::Variable && sourceVariable(index))) {
QModelIndex srcindex = mapToSource(index); QModelIndex srcindex = mapToSource(index);
if (value.toInt() == Qt::Checked && !m_checkStates.value(srcindex, false)) { if (value.toInt() == Qt::Checked && !m_checkStates.value(srcindex, false)) {
m_checkStates.insert(srcindex, true); m_checkStates.insert(srcindex, true);

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef PROEDITORMODEL_H #ifndef PROEDITORMODEL_H
#define PROEDITORMODEL_H #define PROEDITORMODEL_H
@@ -41,10 +42,12 @@
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtGui/QSortFilterProxyModel> #include <QtGui/QSortFilterProxyModel>
QT_FORWARD_DECLARE_CLASS(ProBlock) QT_BEGIN_NAMESPACE
QT_FORWARD_DECLARE_CLASS(ProFile) class ProBlock;
QT_FORWARD_DECLARE_CLASS(ProItem) class ProFile;
QT_FORWARD_DECLARE_CLASS(ProVariable) class ProItem;
class ProVariable;
QT_END_NAMESPACE
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
@@ -146,8 +149,8 @@ private:
QMap<QModelIndex, bool> m_checkStates; QMap<QModelIndex, bool> m_checkStates;
}; };
} //namespace Internal } // namespace Internal
} //namespace Qt4ProjectManager } // namespace Qt4ProjectManager
#endif //PROEDITORMODEL_H #endif // PROEDITORMODEL_H

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include "profileevaluator.h" #include "profileevaluator.h"
#include "proparserutils.h" #include "proparserutils.h"
#include "proitems.h" #include "proitems.h"

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef PROFILEEVALUATOR_H #ifndef PROFILEEVALUATOR_H
#define PROFILEEVALUATOR_H #define PROFILEEVALUATOR_H
@@ -91,4 +92,3 @@ private:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // PROFILEEVALUATOR_H #endif // PROFILEEVALUATOR_H

View File

@@ -30,15 +30,16 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include "proiteminfo.h" #include "proiteminfo.h"
#include <QtCore/QFile> #include <QtCore/QFile>
using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager::Internal;
ProItemInfo::ProItemInfo(ProItemInfoKind kind) ProItemInfo::ProItemInfo(ProItemInfoKind kind)
: m_kind(kind) { } : m_kind(kind)
{ }
ProItemInfo::ProItemInfoKind ProItemInfo::kind() const ProItemInfo::ProItemInfoKind ProItemInfo::kind() const
{ {
@@ -76,10 +77,12 @@ QString ProItemInfo::description() const
} }
ProScopeInfo::ProScopeInfo() ProScopeInfo::ProScopeInfo()
: ProItemInfo(ProItemInfo::Scope) { } : ProItemInfo(ProItemInfo::Scope)
{ }
ProValueInfo::ProValueInfo() ProValueInfo::ProValueInfo()
: ProItemInfo(ProItemInfo::Value) { } : ProItemInfo(ProItemInfo::Value)
{ }
ProVariableInfo::ProVariableInfo() ProVariableInfo::ProVariableInfo()
: ProItemInfo(ProItemInfo::Variable) : ProItemInfo(ProItemInfo::Variable)
@@ -107,7 +110,6 @@ void ProVariableInfo::setDefaultOperator(ProVariable::VariableOperator op)
m_operator = op; m_operator = op;
} }
ProValueInfo *ProVariableInfo::value(const QString &id) const ProValueInfo *ProVariableInfo::value(const QString &id) const
{ {
return m_values.value(id, 0); return m_values.value(id, 0);

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef PROITEMINFO_H #ifndef PROITEMINFO_H
#define PROITEMINFO_H #define PROITEMINFO_H
@@ -44,7 +45,8 @@
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
class ProItemInfo { class ProItemInfo
{
public: public:
enum ProItemInfoKind { enum ProItemInfoKind {
Scope, Scope,
@@ -70,17 +72,20 @@ private:
ProItemInfoKind m_kind; ProItemInfoKind m_kind;
}; };
class ProScopeInfo : public ProItemInfo { class ProScopeInfo : public ProItemInfo
{
public: public:
ProScopeInfo(); ProScopeInfo();
}; };
class ProValueInfo : public ProItemInfo { class ProValueInfo : public ProItemInfo
{
public: public:
ProValueInfo(); ProValueInfo();
}; };
class ProVariableInfo : public ProItemInfo { class ProVariableInfo : public ProItemInfo
{
public: public:
ProVariableInfo(); ProVariableInfo();
~ProVariableInfo(); ~ProVariableInfo();
@@ -126,7 +131,7 @@ private:
QMap<QString, ProVariableInfo *> m_variables; QMap<QString, ProVariableInfo *> m_variables;
}; };
} //namespace Internal } // namespace Internal
} //namespace Qt4ProjectManager } // namespace Qt4ProjectManager
#endif //PROITEMINFO_H #endif // PROITEMINFO_H

View File

@@ -30,13 +30,15 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include <QtCore/QFileInfo>
#include <QtCore/QDebug>
#include "proitems.h" #include "proitems.h"
#include "abstractproitemvisitor.h" #include "abstractproitemvisitor.h"
#include <QtCore/QFileInfo>
#include <QtCore/QDebug>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
// --------------- ProItem ------------ // --------------- ProItem ------------
void ProItem::setComment(const QString &comment) void ProItem::setComment(const QString &comment)
{ {
@@ -278,7 +280,6 @@ ProFile::ProFile(const QString &fileName)
ProFile::~ProFile() ProFile::~ProFile()
{ {
} }
QString ProFile::displayFileName() const QString ProFile::displayFileName() const

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef PROITEMS_H #ifndef PROITEMS_H
#define PROITEMS_H #define PROITEMS_H

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef PROPARSERUTILS_H #ifndef PROPARSERUTILS_H
#define PROPARSERUTILS_H #define PROPARSERUTILS_H
@@ -272,4 +273,3 @@ static QStringList qmake_mkspec_paths()
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // PROPARSERUTILS_H #endif // PROPARSERUTILS_H

View File

@@ -30,11 +30,12 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include <QtCore/QFile>
#include "proitems.h" #include "proitems.h"
#include "prowriter.h" #include "prowriter.h"
#include <QtCore/QFile>
using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager::Internal;
bool ProWriter::write(ProFile *profile, const QString &fileName) bool ProWriter::write(ProFile *profile, const QString &fileName)

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef PROWRITER_H #ifndef PROWRITER_H
#define PROWRITER_H #define PROWRITER_H
@@ -37,15 +38,18 @@
#include <QtCore/QTextStream> #include <QtCore/QTextStream>
QT_FORWARD_DECLARE_CLASS(ProFile) QT_BEGIN_NAMESPACE
QT_FORWARD_DECLARE_CLASS(ProValue) class ProFile;
QT_FORWARD_DECLARE_CLASS(ProItem) class ProValue;
QT_FORWARD_DECLARE_CLASS(ProBlock) class ProItem;
class ProBlock;
QT_END_NAMESPACE
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
class ProWriter { class ProWriter
{
public: public:
bool write(ProFile *profile, const QString &fileName); bool write(ProFile *profile, const QString &fileName);
QString contents(ProFile *profile); QString contents(ProFile *profile);
@@ -69,7 +73,7 @@ private:
QString m_comment; QString m_comment;
}; };
} //namespace Internal } // namespace Internal
} //namespace Qt4ProjectManager } // namespace Qt4ProjectManager
#endif //PROWRITER_H #endif // PROWRITER_H

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include "proxml.h" #include "proxml.h"
#include "proitems.h" #include "proitems.h"

View File

@@ -30,13 +30,17 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef PROXML_H #ifndef PROXML_H
#define PROXML_H #define PROXML_H
#include "namespace_global.h" #include "namespace_global.h"
#include <QtXml> #include <QtXml>
QT_FORWARD_DECLARE_CLASS(ProItem)
QT_BEGIN_NAMESPACE
class ProItem;
QT_END_NAMESPACE
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
@@ -50,7 +54,7 @@ private:
ProItem *parseItemNode(QDomDocument doc, QDomNode node) const; ProItem *parseItemNode(QDomDocument doc, QDomNode node) const;
}; };
} //namespace Internal } // namespace Internal
} //namespace Qt4ProjectManager } // namespace Qt4ProjectManager
#endif //PROXML_H #endif // PROXML_H

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include "valueeditor.h" #include "valueeditor.h"
#include "proitems.h" #include "proitems.h"
#include "proeditormodel.h" #include "proeditormodel.h"
@@ -40,8 +41,8 @@
using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager::Internal;
ValueEditor::ValueEditor(QWidget *parent) : ValueEditor::ValueEditor(QWidget *parent)
QWidget(parent), : QWidget(parent),
m_model(0), m_model(0),
m_handleModelChanges(true), m_handleModelChanges(true),
m_infomanager(0) m_infomanager(0)
@@ -434,7 +435,8 @@ void ValueEditor::updateItemChanges(QListWidgetItem *item)
m_handleModelChanges = true; m_handleModelChanges = true;
} }
void ValueEditor::updateVariableId() { void ValueEditor::updateVariableId()
{
if (!m_model) if (!m_model)
return; return;
m_handleModelChanges = false; m_handleModelChanges = false;
@@ -442,7 +444,8 @@ void ValueEditor::updateVariableId() {
m_handleModelChanges = true; m_handleModelChanges = true;
} }
void ValueEditor::updateVariableId(int index) { void ValueEditor::updateVariableId(int index)
{
if (!m_model) if (!m_model)
return; return;
ProVariableInfo *info = m_infomanager->variable(m_varComboBox->itemData(index).toString()); ProVariableInfo *info = m_infomanager->variable(m_varComboBox->itemData(index).toString());
@@ -451,7 +454,8 @@ void ValueEditor::updateVariableId(int index) {
m_model->setData(m_currentIndex, info->defaultOperator()); m_model->setData(m_currentIndex, info->defaultOperator());
} }
void ValueEditor::updateVariableOp(int index) { void ValueEditor::updateVariableOp(int index)
{
if (!m_model) if (!m_model)
return; return;
m_handleModelChanges = false; m_handleModelChanges = false;
@@ -459,7 +463,8 @@ void ValueEditor::updateVariableOp(int index) {
m_handleModelChanges = true; m_handleModelChanges = true;
} }
void ValueEditor::updateItemId() { void ValueEditor::updateItemId()
{
if (!m_model) if (!m_model)
return; return;
QModelIndex index = m_currentIndex; QModelIndex index = m_currentIndex;
@@ -476,7 +481,8 @@ void ValueEditor::updateItemId() {
m_handleModelChanges = true; m_handleModelChanges = true;
} }
void ValueEditor::updateItemId(int index) { void ValueEditor::updateItemId(int index)
{
if (!m_model) if (!m_model)
return; return;
QModelIndex idx = m_currentIndex; QModelIndex idx = m_currentIndex;

View File

@@ -30,15 +30,16 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#ifndef VALUEEDITOR_H #ifndef VALUEEDITOR_H
#define VALUEEDITOR_H #define VALUEEDITOR_H
#include "namespace_global.h" #include "namespace_global.h"
#include "ui_valueeditor.h"
#include <QtCore/QList> #include <QtCore/QList>
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <QtCore/QPointer> #include <QtCore/QPointer>
#include "ui_valueeditor.h"
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class ProBlock; class ProBlock;
@@ -51,8 +52,7 @@ namespace Internal {
class ProEditorModel; class ProEditorModel;
class ProItemInfoManager; class ProItemInfoManager;
class ValueEditor : public QWidget, class ValueEditor : public QWidget, protected Ui::ValueEditor
protected Ui::ValueEditor
{ {
Q_OBJECT Q_OBJECT
@@ -113,7 +113,7 @@ private:
ProItemInfoManager *m_infomanager; ProItemInfoManager *m_infomanager;
}; };
} //namespace Internal } // namespace Internal
} //namespace Qt4ProjectManager } // namespace Qt4ProjectManager
#endif //VALUEEDITOR_H #endif // VALUEEDITOR_H

View File

@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package. ** 1.2, included in the file GPL_EXCEPTION.txt in this package.
** **
***************************************************************************/ ***************************************************************************/
#include "qrceditor.h" #include "qrceditor.h"
#include "undocommands_p.h" #include "undocommands_p.h"
@@ -40,8 +41,8 @@
namespace SharedTools { namespace SharedTools {
QrcEditor::QrcEditor(QWidget *parent) : QrcEditor::QrcEditor(QWidget *parent)
QWidget(parent), : QWidget(parent),
m_treeview(new ResourceView(&m_history)), m_treeview(new ResourceView(&m_history)),
m_addFileAction(0) m_addFileAction(0)
{ {
@@ -62,18 +63,18 @@ QrcEditor::QrcEditor(QWidget *parent) :
m_ui.addButton->setMenu(addMenu); m_ui.addButton->setMenu(addMenu);
connect(m_treeview, SIGNAL(addPrefixTriggered()), this, SLOT(onAddPrefix())); connect(m_treeview, SIGNAL(addPrefixTriggered()), this, SLOT(onAddPrefix()));
connect(m_treeview, SIGNAL(addFilesTriggered(const QString &)), this, SLOT(onAddFiles())); connect(m_treeview, SIGNAL(addFilesTriggered(QString)), this, SLOT(onAddFiles()));
connect(m_treeview, SIGNAL(removeItem()), this, SLOT(onRemove())); connect(m_treeview, SIGNAL(removeItem()), this, SLOT(onRemove()));
connect(m_treeview, SIGNAL(currentIndexChanged()), this, SLOT(updateCurrent())); connect(m_treeview, SIGNAL(currentIndexChanged()), this, SLOT(updateCurrent()));
connect(m_treeview, SIGNAL(dirtyChanged(bool)), this, SIGNAL(dirtyChanged(bool))); connect(m_treeview, SIGNAL(dirtyChanged(bool)), this, SIGNAL(dirtyChanged(bool)));
m_treeview->setFocus(); m_treeview->setFocus();
connect(m_ui.aliasText, SIGNAL(textEdited(const QString &)), connect(m_ui.aliasText, SIGNAL(textEdited(QString)),
this, SLOT(onAliasChanged(const QString &))); this, SLOT(onAliasChanged(QString)));
connect(m_ui.prefixText, SIGNAL(textEdited(const QString &)), connect(m_ui.prefixText, SIGNAL(textEdited(QString)),
this, SLOT(onPrefixChanged(const QString &))); this, SLOT(onPrefixChanged(QString)));
connect(m_ui.languageText, SIGNAL(textEdited(const QString &)), connect(m_ui.languageText, SIGNAL(textEdited(QString)),
this, SLOT(onLanguageChanged(const QString &))); this, SLOT(onLanguageChanged(QString)));
// Prevent undo command merging after a switch of focus: // Prevent undo command merging after a switch of focus:
// (0) The initial text is "Green". // (0) The initial text is "Green".

View File

@@ -54,6 +54,7 @@
#include <Lexer.h> #include <Lexer.h>
#include <Token.h> #include <Token.h>
#include <QtDebug> #include <QtDebug>
#include <algorithm>
using namespace rpp; using namespace rpp;
using namespace CPlusPlus; using namespace CPlusPlus;