Commit f61e8672 authored by hjk's avatar hjk

more cosmetic changes

parent 1472bdb0
......@@ -30,9 +30,6 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
/*
TRANSLATOR qdesigner_internal::ResourceModel
*/
#include "resourcefile_p.h"
......@@ -50,6 +47,10 @@ TRANSLATOR qdesigner_internal::ResourceModel
QT_BEGIN_NAMESPACE
/*
TRANSLATOR qdesigner_internal::ResourceModel
*/
namespace qdesigner_internal {
/******************************************************************************
......@@ -956,7 +957,7 @@ QString ResourceModel::resourcePath(const QString &prefix, const QString &file)
return QDir::cleanPath(rc);
}
QMimeData *ResourceModel::mimeData(const QModelIndexList & indexes) const
QMimeData *ResourceModel::mimeData(const QModelIndexList &indexes) const
{
if (indexes.size() != 1)
return 0;
......@@ -977,6 +978,7 @@ QMimeData *ResourceModel::mimeData(const QModelIndexList & indexes) const
rc->setText(doc.toString());
return rc;
}
} // namespace qdesigner_internal
QT_END_NAMESPACE
......@@ -30,8 +30,9 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef RESOURCEFILE_H
#define RESOURCEFILE_H
#ifndef RESOURCEFILE__P_H
#define RESOURCEFILE__P_H
#include "namespace_global.h"
......@@ -62,8 +63,6 @@ struct Prefix;
*/
class Node
{
File *m_file;
Prefix *m_prefix;
protected:
Node(File *file, Prefix *prefix) : m_file(file), m_prefix(prefix)
{
......@@ -72,6 +71,9 @@ protected:
public:
File * file() { return m_file; }
Prefix * prefix() { Q_ASSERT(m_prefix != NULL); return m_prefix; }
private:
File *m_file;
Prefix *m_prefix;
};
/*!
......@@ -95,7 +97,8 @@ typedef QList<File *> FileList;
Represents a prefix node in a \l ResourceFile tree.
*/
struct Prefix : public Node {
struct Prefix : public Node
{
Prefix(const QString &_name = QString(), const QString &_lang = QString(), const FileList &_file_list = FileList())
: Node(NULL, this), name(_name), lang(_lang), file_list(_file_list) {}
~Prefix()
......@@ -263,4 +266,4 @@ private:
QT_END_NAMESPACE
#endif // RESOURCEFILE_H
#endif // RESOURCEFILE_P_H
......@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "resourceview.h"
#include "undocommands_p.h"
......@@ -658,4 +659,4 @@ bool ResourceView::resourceDragEnabled() const
return m_qrcModel->resourceDragEnabled();
}
}
} // namespace SharedTools
......@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef RESOURCEVIEW_H
#define RESOURCEVIEW_H
......@@ -42,10 +43,12 @@
using namespace qdesigner_internal;
QT_FORWARD_DECLARE_CLASS(QAction)
QT_FORWARD_DECLARE_CLASS(QMenu)
QT_FORWARD_DECLARE_CLASS(QMouseEvent)
QT_FORWARD_DECLARE_CLASS(QUndoStack)
QT_BEGIN_NAMESPACE
class QAction;
class QMenu;
class QMouseEvent;
class QUndoStack;
QT_END_NAMESPACE
namespace SharedTools {
......@@ -178,6 +181,6 @@ private:
int m_mergeId;
};
}
} // namespace SharedTools
#endif //RESOURCEVIEW_H
#endif // RESOURCEVIEW_H
......@@ -30,12 +30,13 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "qrceditor.h"
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication app(argc,argv);
QApplication app(argc, argv);
MainWindow mw;
mw.show();
return app.exec();
......
......@@ -30,16 +30,16 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "mainwindow.h"
#include "qrceditor.h"
#include <QMenuBar>
#include <QAction>
#include <QVBoxLayout>
#include <QDebug>
#include <QFileDialog>
#include <QMenuBar>
#include <QStatusBar>
#include <qdebug.h>
#include <QVBoxLayout>
MainWindow::MainWindow() :
m_qrcEditor(new SharedTools::QrcEditor())
......@@ -67,7 +67,7 @@ MainWindow::MainWindow() :
void MainWindow::slotOpen()
{
const QString fileName = QFileDialog::getOpenFileName (this, tr("Choose resource file"),
const QString fileName = QFileDialog::getOpenFileName(this, tr("Choose resource file"),
QString(),
tr("Resource files (*.qrc)"));
if (fileName.isEmpty())
......@@ -85,7 +85,7 @@ void MainWindow::slotSave()
QString fileName = oldFileName;
if (fileName.isEmpty()) {
fileName = QFileDialog::getSaveFileName (this, tr("Save resource file"),
fileName = QFileDialog::getSaveFileName(this, tr("Save resource file"),
QString(),
tr("Resource files (*.qrc)"));
if (fileName.isEmpty())
......
......@@ -30,8 +30,9 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef _MAINWINDOW_
#define _MAINWINDOW_
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
......@@ -39,7 +40,8 @@ namespace SharedTools {
class QrcEditor;
}
class MainWindow : public QMainWindow {
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
......@@ -51,6 +53,6 @@ private slots:
private:
SharedTools::QrcEditor *m_qrcEditor;
}; // MainWindow
};
#endif
#endif // MAINWINDOW_H
......@@ -30,18 +30,6 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
/****************************************************************************
**
** Copyright (C) 2008-$THISYEAR$ $TROLLTECH$. All rights reserved.
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
** $TROLLTECH_DUAL_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.
**
****************************************************************************/
#include "undocommands_p.h"
......@@ -104,7 +92,7 @@ bool ModifyPropertyCommand::mergeWith(const QUndoCommand * command)
{
const ModifyPropertyCommand * const brother
= dynamic_cast<const ModifyPropertyCommand *>(command);
if ((command == NULL) || (m_property != brother->m_property))
if (command == NULL || m_property != brother->m_property)
return false;
// Choose older command (this) and forgot the other
......@@ -125,9 +113,8 @@ void ModifyPropertyCommand::undo()
void ModifyPropertyCommand::redo()
{
// Prevent execution from within QUndoStack::push
if (m_after.isNull()) {
if (m_after.isNull())
return;
}
// Bring back text before undo
Q_ASSERT(m_view != NULL);
......
......@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef UNDO_COMMANDS_H
#define UNDO_COMMANDS_H
......@@ -38,7 +39,9 @@
#include <QtCore/QString>
#include <QtGui/QUndoCommand>
QT_FORWARD_DECLARE_CLASS(QModelIndex);
QT_BEGIN_NAMESPACE
class QModelIndex;
QT_END_NAMESPACE
namespace SharedTools {
......
......@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "qscripthighlighter.h"
#include <QtCore/QSet>
......@@ -105,7 +106,7 @@ static const QSet<QString> &qscriptKeywords() {
}
namespace SharedTools {
namespace SharedTools {
QScriptHighlighter::QScriptHighlighter(QTextDocument *parent)
: QSyntaxHighlighter(parent)
......@@ -438,10 +439,9 @@ void QScriptHighlighter::highlightKeyword(int currentPos, const QString &buffer)
if (buffer.at(0) == QLatin1Char('Q')) {
setFormat(currentPos - buffer.length(), buffer.length(), m_formats[TypeFormat]);
} else {
if (qscriptKeywords().contains(buffer)) {
if (qscriptKeywords().contains(buffer))
setFormat(currentPos - buffer.length(), buffer.length(), m_formats[KeywordFormat]);
}
}
}
const QVector<QTextCharFormat> &QScriptHighlighter::defaultFormats()
......@@ -466,7 +466,8 @@ void QScriptHighlighter::setFormats(const QVector<QTextCharFormat> &s)
qCopy(s.constBegin(), s.constEnd(), m_formats);
}
int QScriptHighlighter::onBlockStart() {
int QScriptHighlighter::onBlockStart()
{
int state = 0;
int previousState = previousBlockState();
if (previousState != -1)
......@@ -476,5 +477,6 @@ int QScriptHighlighter::onBlockStart() {
void QScriptHighlighter::onOpeningParenthesis(QChar, int) {}
void QScriptHighlighter::onClosingParenthesis(QChar, int) {}
void QScriptHighlighter::onBlockEnd(int state, int) { return setCurrentBlockState(state); }
}
} // namespace SharedTools
......@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef QSCRIPTSYNTAXHIGHLIGHTER_H
#define QSCRIPTSYNTAXHIGHLIGHTER_H
......@@ -59,7 +60,8 @@ private:
virtual int onBlockStart(); // returns the blocks initial state
virtual void onOpeningParenthesis(QChar parenthesis, int pos);
virtual void onClosingParenthesis(QChar parenthesis, int pos);
virtual void onBlockEnd(int state, int firstNonSpace); // sets the enriched user state, or simply calls setCurrentBlockState(state);
// sets the enriched user state, or simply calls setCurrentBlockState(state);
virtual void onBlockEnd(int state, int firstNonSpace);
void highlightKeyword(int currentPos, const QString &buffer);
......
......@@ -30,7 +30,9 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "qscripthighlighter.h"
#include <QTextEdit>
#include <QMainWindow>
#include <QApplication>
......
......@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef QTEXTENDED_INTEGRATION
#define QTEXTENDED_INTEGRATION
......
......@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "qtlockedfile.h"
namespace SharedTools {
......@@ -158,4 +159,4 @@ QtLockedFile::LockMode QtLockedFile::lockMode() const
Destroys the \e QtLockedFile object. If any locks were held, they are released.
*/
}
} // namespace SharedTools
......@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef QTLOCKEDFILE_H
#define QTLOCKEDFILE_H
......@@ -75,6 +76,6 @@ private:
LockMode m_lock_mode;
};
}
} // namespace SharedTools
#endif
#endif // QTLOCKEDFILE_H
......@@ -30,13 +30,14 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "qtlockedfile.h"
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include "qtlockedfile.h"
namespace SharedTools {
bool QtLockedFile::lock(LockMode mode, bool block)
......@@ -107,4 +108,4 @@ QtLockedFile::~QtLockedFile()
unlock();
}
}
} // namespace SharedTools
......@@ -30,7 +30,9 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "qtlockedfile.h"
#include <qt_windows.h>
#include <QtCore/QFileInfo>
......@@ -202,4 +204,4 @@ QtLockedFile::~QtLockedFile()
}
}
}
} // namespace SharedTools
......@@ -32,6 +32,7 @@
***************************************************************************/
#include "qtlocalpeer.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QTime>
......@@ -176,4 +177,4 @@ void QtLocalPeer::receiveConnection()
emit messageReceived(message); // ##(might take a long time to return)
}
}
} // namespace SharedTools
......@@ -31,11 +31,11 @@
**
***************************************************************************/
#include "qtlockedfile.h"
#include <QtNetwork/QLocalServer>
#include <QtNetwork/QLocalSocket>
#include <QtCore/QDir>
#include <qtlockedfile.h>
namespace SharedTools {
......@@ -66,4 +66,4 @@ private:
static const char* ack;
};
} // SharedTools
} // namespace SharedTools
......@@ -33,6 +33,7 @@
#include "qtsingleapplication.h"
#include "qtlocalpeer.h"
#include <QtGui/QWidget>
#include <QtGui/QFileOpenEvent>
......@@ -80,7 +81,8 @@ QtSingleApplication::QtSingleApplication(Display *dpy, int &argc, char **argv, Q
sysInit();
}
QtSingleApplication::QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual, Qt::HANDLE colormap)
QtSingleApplication::QtSingleApplication(Display* dpy, const QString &appId,
int argc, char **argv, Qt::HANDLE visual, Qt::HANDLE colormap)
: QApplication(dpy, argc, argv, visual, colormap)
{
sysInit(appId);
......@@ -115,13 +117,13 @@ QString QtSingleApplication::id() const
}
void QtSingleApplication::setActivationWindow(QWidget* aw, bool activateOnMessage)
void QtSingleApplication::setActivationWindow(QWidget *aw, bool activateOnMessage)
{
actWin = aw;
if (activateOnMessage)
connect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow()));
connect(peer, SIGNAL(messageReceived(QString)), this, SLOT(activateWindow()));
else
disconnect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow()));
disconnect(peer, SIGNAL(messageReceived(QString)), this, SLOT(activateWindow()));
}
......@@ -140,4 +142,4 @@ void QtSingleApplication::activateWindow()
}
}
}
} // namespace SharedTools
......@@ -82,4 +82,4 @@ private:
QWidget *actWin;
};
}
} // namespace SharedTools
......@@ -40,7 +40,7 @@ QtSingleCoreApplication::QtSingleCoreApplication(int &argc, char **argv)
: QCoreApplication(argc, argv)
{
peer = new QtLocalPeer(this);
connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&)));
connect(peer, SIGNAL(messageReceived(QString)), SIGNAL(messageReceived(QString)));
}
......@@ -48,7 +48,7 @@ QtSingleCoreApplication::QtSingleCoreApplication(const QString &appId, int &argc
: QCoreApplication(argc, argv)
{
peer = new QtLocalPeer(this, appId);
connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&)));
connect(peer, SIGNAL(messageReceived(QString)), SIGNAL(messageReceived(QString)));
}
......@@ -69,4 +69,4 @@ QString QtSingleCoreApplication::id() const
return peer->applicationId();
}
}
} // namespace SharedTools
......@@ -60,4 +60,4 @@ private:
QtLocalPeer* peer;
};
}
} // namespace SharedTools
......@@ -30,13 +30,14 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef INTERFACE_WRAP_HELPERS_H
#define INTERFACE_WRAP_HELPERS_H
#include <extensionsystem/ExtensionSystemInterfaces>
#include <QtScript/QScriptEngine>
namespace SharedTools {
namespace SharedTools {
// Convert a QObjectInterface to Scriptvalue
// To be registered as a magic creation function with qScriptRegisterMetaType().
......@@ -87,6 +88,6 @@ static void registerQObjectInterface(QScriptEngine &engine)
Q_UNUSED(metaTypeId);
}
}
} // namespace SharedTools
#endif
#endif // INTERFACE_WRAP_HELPERS_H
......@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef WRAP_HELPERS_H
#define WRAP_HELPERS_H
......@@ -329,6 +330,6 @@ static void registerQObject(QScriptEngine &engine)
scriptValueToQObject<SomeQObject>);
}
}
} // namespace SharedTools
#endif
#endif // WRAP_HELPERS_H
......@@ -51,7 +51,7 @@
# include <sys/resource.h>
#endif
enum { OptionIndent =4, DescriptionIndent = 24 };
enum { OptionIndent = 4, DescriptionIndent = 24 };
static const char *appNameC = "Qt Creator";
static const char *corePluginNameC = "Core";
......