Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tobias Hunger
qt-creator
Commits
1472bdb0
Commit
1472bdb0
authored
Dec 02, 2008
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some file cosmetics (mostly #include order and whitespace)
parent
e2fb40c7
Changes
52
Hide whitespace changes
Inline
Side-by-side
Showing
52 changed files
with
213 additions
and
206 deletions
+213
-206
doc/example/textfinder/main.cpp
doc/example/textfinder/main.cpp
+3
-1
doc/example/textfinder/textfinder.cpp
doc/example/textfinder/textfinder.cpp
+4
-2
doc/example/textfinder/textfinder.h
doc/example/textfinder/textfinder.h
+3
-1
shared/cpaster/cgi.cpp
shared/cpaster/cgi.cpp
+2
-3
shared/cpaster/cgi.h
shared/cpaster/cgi.h
+5
-4
shared/cpaster/fetcher.cpp
shared/cpaster/fetcher.cpp
+2
-1
shared/cpaster/fetcher.h
shared/cpaster/fetcher.h
+1
-1
shared/cpaster/poster.cpp
shared/cpaster/poster.cpp
+2
-1
shared/cpaster/poster.h
shared/cpaster/poster.h
+1
-1
shared/cpaster/splitter.cpp
shared/cpaster/splitter.cpp
+2
-0
shared/cpaster/splitter.h
shared/cpaster/splitter.h
+2
-1
shared/cpaster/view.cpp
shared/cpaster/view.cpp
+1
-1
shared/cpaster/view.h
shared/cpaster/view.h
+1
-1
shared/cplusplus/Array.cpp
shared/cplusplus/Array.cpp
+0
-19
shared/cplusplus/LiteralTable.cpp
shared/cplusplus/LiteralTable.cpp
+0
-19
shared/designerintegrationv2/widgethost.cpp
shared/designerintegrationv2/widgethost.cpp
+1
-0
shared/designerintegrationv2/widgethost.h
shared/designerintegrationv2/widgethost.h
+1
-1
shared/designerintegrationv2/widgethostconstants.h
shared/designerintegrationv2/widgethostconstants.h
+2
-1
shared/help/contentwindow.cpp
shared/help/contentwindow.cpp
+1
-1
shared/help/contentwindow.h
shared/help/contentwindow.h
+2
-2
shared/help/filternamedialog.cpp
shared/help/filternamedialog.cpp
+1
-1
shared/help/helpviewer.cpp
shared/help/helpviewer.cpp
+2
-2
shared/help/indexwindow.cpp
shared/help/indexwindow.cpp
+6
-7
shared/help/indexwindow.h
shared/help/indexwindow.h
+3
-3
shared/help/topicchooser.h
shared/help/topicchooser.h
+3
-2
shared/indenter/constants.cpp
shared/indenter/constants.cpp
+1
-0
shared/indenter/indenter.h
shared/indenter/indenter.h
+2
-1
shared/indenter/indenter_impl.h
shared/indenter/indenter_impl.h
+3
-14
shared/indenter/test/main.cpp
shared/indenter/test/main.cpp
+16
-15
shared/namespace_global.h
shared/namespace_global.h
+1
-1
shared/proparser/abstractproitemvisitor.h
shared/proparser/abstractproitemvisitor.h
+3
-2
shared/proparser/procommandmanager.cpp
shared/proparser/procommandmanager.cpp
+9
-11
shared/proparser/procommandmanager.h
shared/proparser/procommandmanager.h
+9
-4
shared/proparser/proeditor.cpp
shared/proparser/proeditor.cpp
+4
-5
shared/proparser/proeditor.h
shared/proparser/proeditor.h
+3
-3
shared/proparser/proeditormodel.cpp
shared/proparser/proeditormodel.cpp
+20
-14
shared/proparser/proeditormodel.h
shared/proparser/proeditormodel.h
+10
-7
shared/proparser/profileevaluator.cpp
shared/proparser/profileevaluator.cpp
+1
-0
shared/proparser/profileevaluator.h
shared/proparser/profileevaluator.h
+1
-1
shared/proparser/proiteminfo.cpp
shared/proparser/proiteminfo.cpp
+7
-5
shared/proparser/proiteminfo.h
shared/proparser/proiteminfo.h
+13
-8
shared/proparser/proitems.cpp
shared/proparser/proitems.cpp
+4
-3
shared/proparser/proitems.h
shared/proparser/proitems.h
+1
-0
shared/proparser/proparserutils.h
shared/proparser/proparserutils.h
+1
-1
shared/proparser/prowriter.cpp
shared/proparser/prowriter.cpp
+2
-1
shared/proparser/prowriter.h
shared/proparser/prowriter.h
+12
-8
shared/proparser/proxml.cpp
shared/proparser/proxml.cpp
+1
-0
shared/proparser/proxml.h
shared/proparser/proxml.h
+8
-4
shared/proparser/valueeditor.cpp
shared/proparser/valueeditor.cpp
+13
-7
shared/proparser/valueeditor.h
shared/proparser/valueeditor.h
+6
-6
shared/qrceditor/qrceditor.cpp
shared/qrceditor/qrceditor.cpp
+10
-9
src/plugins/cpptools/rpp/pp-engine.cpp
src/plugins/cpptools/rpp/pp-engine.cpp
+1
-0
No files found.
doc/example/textfinder/main.cpp
View file @
1472bdb0
...
...
@@ -30,9 +30,11 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include <QtGui/QApplication>
#include "textfinder.h"
#include <QtGui/QApplication>
int
main
(
int
argc
,
char
*
argv
[])
{
Q_INIT_RESOURCE
(
textfinder
);
...
...
doc/example/textfinder/textfinder.cpp
View file @
1472bdb0
...
...
@@ -30,10 +30,12 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include <QtGui/QMessageBox>
#include "textfinder.h"
#include <QtCore/QFile>
#include <QtCore/QTextStream>
#include
"textfinder.h"
#include
<QtGui/QMessageBox>
TextFinder
::
TextFinder
(
QWidget
*
parent
,
Qt
::
WFlags
flags
)
:
QWidget
(
parent
,
flags
)
...
...
doc/example/textfinder/textfinder.h
View file @
1472bdb0
...
...
@@ -30,12 +30,14 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef TEXTFINDER_H
#define TEXTFINDER_H
#include <QtGui/QWidget>
#include "ui_textfinder.h"
#include <QtGui/QWidget>
class
QPushButton
;
class
QTextEdit
;
class
QLineEdit
;
...
...
shared/cpaster/cgi.cpp
View file @
1472bdb0
...
...
@@ -30,13 +30,14 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "cgi.h"
#include <QByteArray>
// -------------------------------------------------------------------------------------------------
const
char
*
cgi_chars
=
"0123456789abcdef"
;
// RFC 1738 suggests lower-case to be optimal
QString
CGI
::
encodeURL
(
const
QString
&
rawText
)
{
QByteArray
utf
=
rawText
.
toUtf8
();
...
...
@@ -424,5 +425,3 @@ QString CGI::encodeHTML(const QString &rawText, int conversionFlags)
return
enc
;
}
// -------------------------------------------------------------------------------------------------
shared/cpaster/cgi.h
View file @
1472bdb0
...
...
@@ -30,8 +30,10 @@
** 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>
class
CGI
...
...
@@ -54,5 +56,4 @@ private:
inline
QChar
hexToChar
(
const
QString
&
hx
);
};
#endif // _CGI_H_
#endif // CGI_H
shared/cpaster/fetcher.cpp
View file @
1472bdb0
...
...
@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "fetcher.h"
#include "cgi.h"
...
...
@@ -44,7 +45,7 @@ Fetcher::Fetcher(const QString &host)
m_status
=
0
;
m_hadError
=
false
;
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
)
...
...
shared/cpaster/fetcher.h
View file @
1472bdb0
...
...
@@ -30,12 +30,12 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef FETCHER_H
#define FETCHER_H
#include <QHttp>
#include <QHttpResponseHeader>
#include <QString>
class
Fetcher
:
public
QHttp
...
...
shared/cpaster/poster.cpp
View file @
1472bdb0
...
...
@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "poster.h"
#include "cgi.h"
...
...
@@ -43,7 +44,7 @@ Poster::Poster(const QString &host)
m_status
=
0
;
m_hadError
=
false
;
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
,
...
...
shared/cpaster/poster.h
View file @
1472bdb0
...
...
@@ -30,12 +30,12 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef POSTER_H
#define POSTER_H
#include <QHttp>
#include <QHttpResponseHeader>
#include <QString>
class
Poster
:
public
QHttp
...
...
shared/cpaster/splitter.cpp
View file @
1472bdb0
...
...
@@ -30,7 +30,9 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "splitter.h"
#include <QRegExp>
FileDataList
splitDiffToFiles
(
const
QByteArray
&
data
)
...
...
shared/cpaster/splitter.h
View file @
1472bdb0
...
...
@@ -30,12 +30,13 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef SPLITTER_H
#define SPLITTER_H
#include <QString>
#include <QByteArray>
#include <QList>
#include <QString>
struct
FileData
{
...
...
shared/cpaster/view.cpp
View file @
1472bdb0
...
...
@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "view.h"
#include <QFontMetrics>
...
...
@@ -38,7 +39,6 @@
#include <QPushButton>
#include <QSettings>
// -------------------------------------------------------------------------------------------------
class
ColumnIndicatorTextEdit
:
public
QTextEdit
{
public:
...
...
shared/cpaster/view.h
View file @
1472bdb0
...
...
@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef VIEW_H
#define VIEW_H
...
...
@@ -63,4 +64,3 @@ private:
};
#endif // VIEW_H
shared/cplusplus/Array.cpp
View file @
1472bdb0
...
...
@@ -30,24 +30,5 @@
** 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"
shared/cplusplus/LiteralTable.cpp
View file @
1472bdb0
...
...
@@ -30,24 +30,5 @@
** 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"
shared/designerintegrationv2/widgethost.cpp
View file @
1472bdb0
...
...
@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "widgethost.h"
#include "formresizer.h"
#include "widgethostconstants.h"
...
...
shared/designerintegrationv2/widgethost.h
View file @
1472bdb0
...
...
@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef WIDGETHOST_H
#define WIDGETHOST_H
...
...
@@ -80,4 +81,3 @@ private:
}
// namespace SharedTools
#endif // WIDGETHOST_H
shared/designerintegrationv2/widgethostconstants.h
View file @
1472bdb0
...
...
@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef WIDGETHOST_CONSTANTS_H
#define WIDGETHOST_CONSTANTS_H
...
...
@@ -40,5 +41,5 @@ namespace SharedTools {
}
}
#endif //WIDGETHOST_CONSTANTS_H
#endif //
WIDGETHOST_CONSTANTS_H
shared/help/contentwindow.cpp
View file @
1472bdb0
...
...
@@ -108,7 +108,7 @@ void ContentWindow::keyPressEvent(QKeyEvent *e)
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
()
==
QEvent
::
MouseButtonRelease
)
{
...
...
shared/help/contentwindow.h
View file @
1472bdb0
...
...
@@ -66,7 +66,7 @@ private slots:
private:
void
focusInEvent
(
QFocusEvent
*
e
);
void
keyPressEvent
(
QKeyEvent
*
e
);
bool
eventFilter
(
QObject
*
o
,
QEvent
*
e
);
bool
eventFilter
(
QObject
*
o
,
QEvent
*
e
);
QHelpEngine
*
m_helpEngine
;
QHelpContentWidget
*
m_contentWidget
;
...
...
@@ -75,4 +75,4 @@ private:
QT_END_NAMESPACE
#endif
#endif
// CONTENTWINDOW_H
shared/help/filternamedialog.cpp
View file @
1472bdb0
...
...
@@ -45,7 +45,7 @@ FilterNameDialog::FilterNameDialog(QWidget *parent)
SIGNAL
(
clicked
()),
this
,
SLOT
(
accept
()));
connect
(
m_ui
.
buttonBox
->
button
(
QDialogButtonBox
::
Cancel
),
SIGNAL
(
clicked
()),
this
,
SLOT
(
reject
()));
connect
(
m_ui
.
lineEdit
,
SIGNAL
(
textChanged
(
const
QString
&
)),
connect
(
m_ui
.
lineEdit
,
SIGNAL
(
textChanged
(
QString
)),
this
,
SLOT
(
updateOkButton
()));
m_ui
.
buttonBox
->
button
(
QDialogButtonBox
::
Ok
)
->
setDisabled
(
true
);
...
...
shared/help/helpviewer.cpp
View file @
1472bdb0
...
...
@@ -214,8 +214,8 @@ HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent)
connect
(
pageAction
(
QWebPage
::
Copy
),
SIGNAL
(
changed
()),
this
,
SLOT
(
actionChanged
()));
connect
(
pageAction
(
QWebPage
::
Back
),
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
(
this
,
SIGNAL
(
urlChanged
(
const
QUrl
&
)),
this
,
SIGNAL
(
sourceChanged
(
const
QUrl
&
)));
connect
(
page
(),
SIGNAL
(
linkHovered
(
QString
,
QString
,
QString
)),
this
,
SIGNAL
(
highlighted
(
QString
)));
connect
(
this
,
SIGNAL
(
urlChanged
(
QUrl
)),
this
,
SIGNAL
(
sourceChanged
(
QUrl
)));
}
void
HelpViewer
::
setSource
(
const
QUrl
&
url
)
...
...
shared/help/indexwindow.cpp
View file @
1472bdb0
...
...
@@ -60,8 +60,8 @@ IndexWindow::IndexWindow(QHelpEngine *helpEngine, QWidget *parent)
m_searchLineEdit
=
new
QLineEdit
();
l
->
setBuddy
(
m_searchLineEdit
);
connect
(
m_searchLineEdit
,
SIGNAL
(
textChanged
(
const
QString
&
)),
this
,
SLOT
(
filterIndices
(
const
QString
&
)));
connect
(
m_searchLineEdit
,
SIGNAL
(
textChanged
(
QString
)),
this
,
SLOT
(
filterIndices
(
QString
)));
m_searchLineEdit
->
installEventFilter
(
this
);
layout
->
setMargin
(
4
);
layout
->
addWidget
(
m_searchLineEdit
);
...
...
@@ -72,11 +72,10 @@ IndexWindow::IndexWindow(QHelpEngine *helpEngine, QWidget *parent)
this
,
SLOT
(
disableSearchLineEdit
()));
connect
(
m_helpEngine
->
indexModel
(),
SIGNAL
(
indexCreated
()),
this
,
SLOT
(
enableSearchLineEdit
()));
connect
(
m_indexWidget
,
SIGNAL
(
linkActivated
(
const
QUrl
&
,
const
QString
&
)),
this
,
SIGNAL
(
linkActivated
(
const
QUrl
&
)));
connect
(
m_indexWidget
,
SIGNAL
(
linksActivated
(
const
QMap
<
QString
,
QUrl
>&
,
const
QString
&
)),
this
,
SIGNAL
(
linksActivated
(
const
QMap
<
QString
,
QUrl
>&
,
const
QString
&
)));
connect
(
m_indexWidget
,
SIGNAL
(
linkActivated
(
QUrl
,
QString
)),
this
,
SIGNAL
(
linkActivated
(
QUrl
)));
connect
(
m_indexWidget
,
SIGNAL
(
linksActivated
(
QMap
<
QString
,
QUrl
>
,
QString
)),
this
,
SIGNAL
(
linksActivated
(
QMap
<
QString
,
QUrl
>
,
QString
)));
connect
(
m_searchLineEdit
,
SIGNAL
(
returnPressed
()),
m_indexWidget
,
SLOT
(
activateCurrentItem
()));
layout
->
addWidget
(
m_indexWidget
);
...
...
shared/help/indexwindow.h
View file @
1472bdb0
...
...
@@ -31,8 +31,8 @@
**
***************************************************************************/
#ifndef INDEXWINDOW
#define INDEXWINDOW
#ifndef INDEXWINDOW
_H
#define INDEXWINDOW
_H
#include <QtCore/QUrl>
#include <QtGui/QWidget>
...
...
@@ -75,4 +75,4 @@ private:
QT_END_NAMESPACE
#endif
#endif
// INDEXWINDOW_H
shared/help/topicchooser.h
View file @
1472bdb0
...
...
@@ -34,12 +34,13 @@
#ifndef TOPICCHOOSER_H
#define TOPICCHOOSER_H
#include "ui_topicchooser.h"
#include <QUrl>
#include <QMap>
#include <QString>
#include <QtGui/QDialog>
#include "ui_topicchooser.h"
QT_BEGIN_NAMESPACE
...
...
@@ -60,4 +61,4 @@ private:
QT_END_NAMESPACE
#endif
#endif
// TOPICCHOOSER_H
shared/indenter/constants.cpp
View file @
1472bdb0
...
...
@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "indenter.h"
using
namespace
SharedTools
::
IndenterInternal
;
...
...
shared/indenter/indenter.h
View file @
1472bdb0
...
...
@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef INDENTER_H
#define INDENTER_H
...
...
@@ -141,4 +142,4 @@ private:
#include "indenter_impl.h"
#endif
#endif
// INDENTER_H
shared/indenter/indenter_impl.h
View file @
1472bdb0
...
...
@@ -30,22 +30,10 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef 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
Script.
...
...
@@ -1120,4 +1108,5 @@ int Indenter<Iterator>::indentForBottomLine(const Iterator ¤t,
#undef YY_SAVE
#undef YY_RESTORE
#endif
#endif // INDENTER_C
shared/indenter/test/main.cpp
View file @
1472bdb0
...
...
@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "indenter.h"
#include <QtCore/QFile>
...
...
@@ -40,12 +41,12 @@
#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
);
if
(
!
f
.
open
(
QIODevice
::
ReadOnly
)
)
{
QFile
f
(
fileName
);
if
(
!
f
.
open
(
QIODevice
::
ReadOnly
))
{
const
QString
msg
=
QString
(
QLatin1String
(
"error: Cannot open file '%1' for reading: %2"
)).
arg
(
fileName
).
arg
(
f
.
errorString
());
qWarning
(
msg
.
toLatin1
().
constData
());
...
...
@@ -119,11 +120,11 @@ static QStringList parseCommandLine(char **begin, char **end)
int
format
(
const
QString
&
fileName
)
{
const
QString
code
=
fileContents
(
fileName
);
if
(
code
==
QString
::
null
)
const
QString
code
=
fileContents
(
fileName
);
if
(
code
==
QString
::
null
)
return
1
;
QStringList
program
=
code
.
split
(
QLatin1Char
(
'\n'
),
QString
::
KeepEmptyParts
);
QStringList
program
=
code
.
split
(
QLatin1Char
(
'\n'
),
QString
::
KeepEmptyParts
);
while
(
!
program
.
isEmpty
())
{
if
(
!
program
.
back
().
trimmed
().
isEmpty
())
break
;
...
...
@@ -138,19 +139,19 @@ int format(const QString &fileName)
const
QChar
newLine
=
QLatin1Char
(
'\n'
);
QStringList
::
const_iterator
cend
=
program
.
constEnd
();
for
(
QStringList
::
const_iterator
it
=
program
.
constBegin
();
it
!=
cend
;
++
it
)
{
for
(
QStringList
::
const_iterator
it
=
program
.
constBegin
();
it
!=
cend
;
++
it
)
{
p
.
push_back
(
*
it
);
QString
&
line
=
p
.
back
();
QChar
typedIn
=
Indenter
::
instance
().
firstNonWhiteSpace
(
line
);
if
(
p
.
last
().
endsWith
(
colon
)
)
if
(
p
.
last
().
endsWith
(
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
();
// 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
+=
trimmed
;
}
...
...
@@ -158,14 +159,14 @@ int format(const QString &fileName)
out
+=
newLine
;
}
while
(
out
.
endsWith
(
newLine
)
)
out
.
truncate
(
out
.
length
()
-
1
);
while
(
out
.
endsWith
(
newLine
))
out
.
truncate
(
out
.
length
()
-
1
);
fputs
(
out
.
toUtf8
().
constData
(),
stdout
);
return
0
;
}
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
const
QStringList
fileNames
=
parseCommandLine
(
argv
,
argv
+
argc
);
if
(
fileNames
.
empty
())
{
...
...
@@ -174,7 +175,7 @@ int main( int argc, char **argv )
}
foreach
(
QString
fileName
,
fileNames
)
if
(
const
int
rc
=
format
(
fileName
))
if
(
const
int
rc
=
format
(
fileName
))
return
rc
;
return
0
;
...
...
shared/namespace_global.h
View file @
1472bdb0
...
...
@@ -49,4 +49,4 @@
# define QT_MANGLE_NAMESPACE(name) name
#endif
#endif
#endif
// NAMESPACE_GLOBAL_H
shared/proparser/abstractproitemvisitor.h
View file @
1472bdb0
...
...
@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef ABSTRACTPROITEMVISITOR
#define ABSTRACTPROITEMVISITOR
...
...
@@ -37,7 +38,8 @@
QT_BEGIN_NAMESPACE
struct
AbstractProItemVisitor
{
struct
AbstractProItemVisitor
{
virtual
~
AbstractProItemVisitor
()
{}
virtual
bool
visitBeginProBlock
(
ProBlock
*
block
)
=
0
;
virtual
bool
visitEndProBlock
(
ProBlock
*
block
)
=
0
;
...
...
@@ -52,7 +54,6 @@ struct AbstractProItemVisitor {
virtual
bool
visitProFunction
(
ProFunction
*
function
)
=
0
;
virtual
bool
visitProOperator
(
ProOperator
*
function
)
=
0
;
virtual
bool
visitProCondition
(
ProCondition
*
function
)
=
0
;
};
QT_END_NAMESPACE
...
...
shared/proparser/procommandmanager.cpp
View file @
1472bdb0
...
...
@@ -30,12 +30,14 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "procommandmanager.h"
using
namespace
Qt4ProjectManager
::
Internal
;
ProCommandGroup
::
ProCommandGroup
(
const
QString
&
name
)
:
m_name
(
name
)
{
}
:
m_name
(
name
)
{
}
ProCommandGroup
::~
ProCommandGroup
()
{
...
...
@@ -49,16 +51,14 @@ void ProCommandGroup::appendCommand(ProCommand *cmd)
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
();
}