Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
f61e8672
Commit
f61e8672
authored
Dec 02, 2008
by
hjk
Browse files
more cosmetic changes
parent
1472bdb0
Changes
262
Hide whitespace changes
Inline
Side-by-side
shared/qrceditor/resourcefile.cpp
View file @
f61e8672
...
...
@@ -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
shared/qrceditor/resourcefile_p.h
View file @
f61e8672
...
...
@@ -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
shared/qrceditor/resourceview.cpp
View file @
f61e8672
...
...
@@ -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
shared/qrceditor/resourceview.h
View file @
f61e8672
...
...
@@ -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
shared/qrceditor/test/main.cpp
View file @
f61e8672
...
...
@@ -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
();
...
...
shared/qrceditor/test/mainwindow.cpp
View file @
f61e8672
...
...
@@ -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
<Q
VBoxLayout
>
#include
<Q
Debug
>
#include
<QFileDialog>
#include
<QMenuBar>
#include
<QStatusBar>
#include
<qdebug.h>
#include
<QVBoxLayout>
MainWindow
::
MainWindow
()
:
m_qrcEditor
(
new
SharedTools
::
QrcEditor
())
...
...
@@ -67,9 +67,9 @@ MainWindow::MainWindow() :
void
MainWindow
::
slotOpen
()
{
const
QString
fileName
=
QFileDialog
::
getOpenFileName
(
this
,
tr
(
"Choose resource file"
),
QString
(),
tr
(
"Resource files (*.qrc)"
));
const
QString
fileName
=
QFileDialog
::
getOpenFileName
(
this
,
tr
(
"Choose resource file"
),
QString
(),
tr
(
"Resource files (*.qrc)"
));
if
(
fileName
.
isEmpty
())
return
;
...
...
@@ -81,13 +81,13 @@ void MainWindow::slotOpen()
void
MainWindow
::
slotSave
()
{
const
QString
oldFileName
=
m_qrcEditor
->
fileName
();
const
QString
oldFileName
=
m_qrcEditor
->
fileName
();
QString
fileName
=
oldFileName
;
if
(
fileName
.
isEmpty
())
{
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Save resource file"
),
QString
(),
tr
(
"Resource files (*.qrc)"
));
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Save resource file"
),
QString
(),
tr
(
"Resource files (*.qrc)"
));
if
(
fileName
.
isEmpty
())
return
;
}
...
...
shared/qrceditor/test/mainwindow.h
View file @
f61e8672
...
...
@@ -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
shared/qrceditor/undocommands.cpp
View file @
f61e8672
...
...
@@ -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
);
...
...
shared/qrceditor/undocommands_p.h
View file @
f61e8672
...
...
@@ -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
{
...
...
shared/qscripthighlighter/qscripthighlighter.cpp
View file @
f61e8672
...
...
@@ -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,9 +439,8 @@ 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
]);
}
}
}
...
...
@@ -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
shared/qscripthighlighter/qscripthighlighter.h
View file @
f61e8672
...
...
@@ -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
);
...
...
shared/qscripthighlighter/test/main.cpp
View file @
f61e8672
...
...
@@ -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>
...
...
shared/qtextended_integration.h
View file @
f61e8672
...
...
@@ -30,6 +30,7 @@
** 1.2, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef QTEXTENDED_INTEGRATION
#define QTEXTENDED_INTEGRATION
...
...
shared/qtlockedfile/qtlockedfile.cpp
View file @
f61e8672
...
...
@@ -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
shared/qtlockedfile/qtlockedfile.h
View file @
f61e8672
...
...
@@ -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
shared/qtlockedfile/qtlockedfile_unix.cpp
View file @
f61e8672
...
...
@@ -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
shared/qtlockedfile/qtlockedfile_win.cpp
View file @
f61e8672
...
...
@@ -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
shared/qtsingleapplication/qtlocalpeer.cpp
View file @
f61e8672
...
...
@@ -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
shared/qtsingleapplication/qtlocalpeer.h
View file @
f61e8672
...
...
@@ -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
shared/qtsingleapplication/qtsingleapplication.cpp
View file @
f61e8672
...
...
@@ -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
Prev
1
2
3
4
5
…
14
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment