summaryrefslogtreecommitdiffstats
path: root/tools/qtconfig
diff options
context:
space:
mode:
authorBoris Moiseev <cyberbobs@gmail.com>2010-10-06 13:51:36 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2010-10-06 13:51:36 (GMT)
commit55f7ab61482cbfdf93ab25e409649ecea9bcdb0e (patch)
tree899135b2cae9875314396f005a9680e9560a9ca4 /tools/qtconfig
parent31ea34d217e28f83cf868c76a998d61a846385e6 (diff)
downloadQt-55f7ab61482cbfdf93ab25e409649ecea9bcdb0e.zip
Qt-55f7ab61482cbfdf93ab25e409649ecea9bcdb0e.tar.gz
Qt-55f7ab61482cbfdf93ab25e409649ecea9bcdb0e.tar.bz2
Resolved some code style issues and fixed the broken copyright year
Merge-request: 2286 Reviewed-by: Benjamin Poulain <benjamin.poulain@nokia.com>
Diffstat (limited to 'tools/qtconfig')
-rw-r--r--tools/qtconfig/mainwindow.cpp51
-rw-r--r--tools/qtconfig/paletteeditoradvanced.cpp14
-rw-r--r--tools/qtconfig/paletteeditoradvanced.h6
-rw-r--r--tools/qtconfig/previewframe.cpp4
-rw-r--r--tools/qtconfig/previewwidget.cpp4
5 files changed, 40 insertions, 39 deletions
diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp
index 12024e7..fd083c1 100644
--- a/tools/qtconfig/mainwindow.cpp
+++ b/tools/qtconfig/mainwindow.cpp
@@ -156,7 +156,7 @@ static const char *phonon_text =
QPalette::ColorGroup MainWindow::groupFromIndex(int item)
{
- switch( item ) {
+ switch (item) {
case 0:
default:
return QPalette::Active;
@@ -272,7 +272,7 @@ MainWindow::MainWindow()
QStringList fs2 = QFont::substitutions();
QStringList::Iterator fsit = fs2.begin();
while (fsit != fs2.end()) {
- if (! fs.contains(*fsit))
+ if (!fs.contains(*fsit))
fs += *fsit;
fsit++;
}
@@ -306,8 +306,8 @@ MainWindow::MainWindow()
else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip))
tooltipeffect->setCurrentIndex(1);
- if ( QApplication::isEffectEnabled( Qt::UI_AnimateToolBox ) )
- toolboxeffect->setCurrentIndex( 1 );
+ if (QApplication::isEffectEnabled(Qt::UI_AnimateToolBox))
+ toolboxeffect->setCurrentIndex(1);
QSize globalStrut = QApplication::globalStrut();
strutwidth->setValue(globalStrut.width());
@@ -526,7 +526,7 @@ void MainWindow::fileSave()
settings.setValue(QLatin1String("style"), overrideDesktopSettings ? gstylecombo->currentText() : QString());
settings.setValue(QLatin1String("doubleClickInterval"), dcispin->value());
- settings.setValue(QLatin1String("cursorFlashTime"), cfispin->value() == 9 ? 0 : cfispin->value() );
+ settings.setValue(QLatin1String("cursorFlashTime"), cfispin->value() == 9 ? 0 : cfispin->value());
settings.setValue(QLatin1String("wheelScrollLines"), wslspin->value());
settings.setValue(QLatin1String("resolveSymlinks"), resolvelinks->isChecked());
@@ -539,13 +539,13 @@ void MainWindow::fileSave()
#ifdef Q_WS_X11
QString style = inputStyle->currentText();
QString str = QLatin1String("On The Spot");
- if ( style == trUtf8( "Over The Spot" ) )
+ if (style == trUtf8("Over The Spot"))
str = QLatin1String("Over The Spot");
- else if ( style == trUtf8( "Off The Spot" ) )
+ else if (style == trUtf8("Off The Spot"))
str = QLatin1String("Off The Spot");
- else if ( style == trUtf8( "Root" ) )
+ else if (style == trUtf8("Root"))
str = QLatin1String("Root");
- settings.setValue( QLatin1String("XIMInputStyle"), str );
+ settings.setValue(QLatin1String("XIMInputStyle"), str);
#endif
#if defined(Q_WS_X11) && !defined(QT_NO_XIM)
settings.setValue(QLatin1String("DefaultInputMethod"), inputMethod->currentText());
@@ -574,7 +574,7 @@ void MainWindow::fileSave()
case 2: effects << QLatin1String("fadetooltip"); break;
}
- switch ( toolboxeffect->currentIndex() ) {
+ switch (toolboxeffect->currentIndex()) {
case 1: effects << QLatin1String("animatetoolbox"); break;
}
} else
@@ -618,8 +618,8 @@ void MainWindow::setModified(bool m)
void MainWindow::buildPalette()
{
QPalette temp(buttonMainColor->color(), buttonWindowColor->color());
- for (int i = 0; i<QPalette::NColorGroups; i++)
- temp = PaletteEditorAdvanced::buildEffect( QPalette::ColorGroup(i), temp );
+ for (int i = 0; i < QPalette::NColorGroups; i++)
+ temp = PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup(i), temp);
editPalette = temp;
@@ -628,15 +628,15 @@ void MainWindow::buildPalette()
setModified(true);
}
-void MainWindow::setPreviewPalette( const QPalette& pal )
+void MainWindow::setPreviewPalette(const QPalette &pal)
{
QPalette::ColorGroup colorGroup = groupFromIndex(paletteCombo->currentIndex());
- for (int i = 0; i<QPalette::NColorGroups; i++) {
+ for (int i = 0; i < QPalette::NColorGroups; i++) {
for (int j = 0; j < QPalette::NColorRoles; j++) {
QPalette::ColorGroup targetGroup = QPalette::ColorGroup(i);
QPalette::ColorRole targetRole = QPalette::ColorRole(j);
- previewPalette.setColor( targetGroup, targetRole, pal.color(colorGroup, targetRole) );
+ previewPalette.setColor(targetGroup, targetRole, pal.color(colorGroup, targetRole));
}
}
@@ -645,8 +645,8 @@ void MainWindow::setPreviewPalette( const QPalette& pal )
void MainWindow::updateColorButtons()
{
- buttonMainColor->setColor( editPalette.color( QPalette::Active, QPalette::Button ));
- buttonWindowColor->setColor( editPalette.color( QPalette::Active, QPalette::Window ));
+ buttonMainColor->setColor(editPalette.color(QPalette::Active, QPalette::Button));
+ buttonWindowColor->setColor(editPalette.color(QPalette::Active, QPalette::Window));
}
void MainWindow::tunePalette()
@@ -654,7 +654,7 @@ void MainWindow::tunePalette()
bool ok;
QPalette pal = PaletteEditorAdvanced::getPalette(&ok, editPalette,
backgroundRole(), this);
- if (! ok)
+ if (!ok)
return;
editPalette = pal;
@@ -881,7 +881,7 @@ void MainWindow::helpAbout()
QMessageBox box(this);
box.setText(tr("<h3>%1</h3>"
"<br/>Version %2"
- "<br/><br/>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).")
+ "<br/><br/>Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).")
.arg(tr("Qt Configuration")).arg(QLatin1String(QT_VERSION_STR)));
box.setWindowTitle(tr("Qt Configuration"));
box.setIcon(QMessageBox::NoIcon);
@@ -910,19 +910,20 @@ void MainWindow::pageChanged(QWidget *page)
void MainWindow::closeEvent(QCloseEvent *e)
{
if (modified) {
- switch(QMessageBox::warning(this, tr("Save Changes"),
- tr("Save changes to settings?"),
- tr("&Yes"), tr("&No"), tr("&Cancel"), 0, 2)) {
- case 0: // save
+ switch (QMessageBox::warning(this, tr("Save Changes"),
+ tr("Save changes to settings?"),
+ (QMessageBox::Yes | QMessageBox::No
+ | QMessageBox::Cancel))) {
+ case QMessageBox::Yes: // save
qApp->processEvents();
fileSave();
// fall through intended
- case 1: // don't save
+ case QMessageBox::No: // don't save
e->accept();
break;
- case 2: // cancel
+ case QMessageBox::Cancel: // cancel
e->ignore();
break;
diff --git a/tools/qtconfig/paletteeditoradvanced.cpp b/tools/qtconfig/paletteeditoradvanced.cpp
index e757d00..b285c8c 100644
--- a/tools/qtconfig/paletteeditoradvanced.cpp
+++ b/tools/qtconfig/paletteeditoradvanced.cpp
@@ -83,7 +83,7 @@ PaletteEditorAdvanced::~PaletteEditorAdvanced()
{
}
-void PaletteEditorAdvanced::onToggleBuildInactive( bool v )
+void PaletteEditorAdvanced::onToggleBuildInactive(bool v)
{
if (selectedPalette == 1) {
groupCentral->setDisabled(v);
@@ -171,7 +171,7 @@ void PaletteEditorAdvanced::onToggleBuildEffects(bool on)
QPalette::ColorGroup PaletteEditorAdvanced::groupFromIndex(int item)
{
- switch( item ) {
+ switch (item) {
case 0:
default:
return QPalette::Active;
@@ -184,7 +184,7 @@ QPalette::ColorGroup PaletteEditorAdvanced::groupFromIndex(int item)
QPalette::ColorRole PaletteEditorAdvanced::centralFromIndex(int item)
{
- switch( item ) {
+ switch (item) {
case 0:
return QPalette::Window;
case 1:
@@ -220,7 +220,7 @@ QPalette::ColorRole PaletteEditorAdvanced::centralFromIndex(int item)
QPalette::ColorRole PaletteEditorAdvanced::effectFromIndex(int item)
{
- switch( item ) {
+ switch (item) {
case 0:
return QPalette::Light;
case 1:
@@ -327,7 +327,7 @@ void PaletteEditorAdvanced::setupBackgroundRole(QPalette::ColorRole role)
{
int initRole = 0;
- switch(role) {
+ switch (role) {
case QPalette::Window:
initRole = 0;
break;
@@ -385,8 +385,8 @@ QPalette PaletteEditorAdvanced::getPalette(bool *ok, const QPalette &init,
PaletteEditorAdvanced *dlg = new PaletteEditorAdvanced(parent);
dlg->setupBackgroundRole(backgroundRole);
- if ( init != QPalette() )
- dlg->setPal( init );
+ if (init != QPalette())
+ dlg->setPal(init);
int resultCode = dlg->exec();
QPalette result = init;
diff --git a/tools/qtconfig/paletteeditoradvanced.h b/tools/qtconfig/paletteeditoradvanced.h
index f70648b..9dc4657 100644
--- a/tools/qtconfig/paletteeditoradvanced.h
+++ b/tools/qtconfig/paletteeditoradvanced.h
@@ -55,9 +55,9 @@ public:
PaletteEditorAdvanced(QWidget *parent = 0);
~PaletteEditorAdvanced();
- static QPalette getPalette( bool *ok, const QPalette &pal,
- QPalette::ColorRole backgroundRole = QPalette::Window,
- QWidget *parent = 0 );
+ static QPalette getPalette(bool *ok, const QPalette &pal,
+ QPalette::ColorRole backgroundRole = QPalette::Window,
+ QWidget *parent = 0);
static QPalette buildEffect(QPalette::ColorGroup colorGroup, const QPalette &basePalette);
diff --git a/tools/qtconfig/previewframe.cpp b/tools/qtconfig/previewframe.cpp
index 95d64cf..d08b770 100644
--- a/tools/qtconfig/previewframe.cpp
+++ b/tools/qtconfig/previewframe.cpp
@@ -82,7 +82,7 @@ void PreviewFrame::setPreviewVisible(bool visible)
workspace->viewport()->update();
}
-Workspace::Workspace(PreviewFrame* parent)
+Workspace::Workspace(PreviewFrame *parent)
: QMdiArea(parent)
{
previewFrame = parent;
@@ -92,7 +92,7 @@ Workspace::Workspace(PreviewFrame* parent)
frame->show();
}
-void Workspace::paintEvent( QPaintEvent* )
+void Workspace::paintEvent(QPaintEvent *)
{
QPainter p(viewport());
p.fillRect(rect(), palette().color(backgroundRole()).dark());
diff --git a/tools/qtconfig/previewwidget.cpp b/tools/qtconfig/previewwidget.cpp
index abbf669..4a4a580 100644
--- a/tools/qtconfig/previewwidget.cpp
+++ b/tools/qtconfig/previewwidget.cpp
@@ -50,7 +50,7 @@ PreviewWidget::PreviewWidget(QWidget *parent)
setupUi(this);
// install event filter on child widgets
- QList<QWidget *> l = findChildren<QWidget*>();
+ QList<QWidget *> l = findChildren<QWidget *>();
foreach(QWidget *w, l) {
w->installEventFilter(this);
w->setFocusPolicy(Qt::NoFocus);
@@ -66,7 +66,7 @@ void PreviewWidget::closeEvent(QCloseEvent *e)
bool PreviewWidget::eventFilter(QObject *, QEvent *e)
{
- switch ( e->type() ) {
+ switch (e->type()) {
case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease:
case QEvent::MouseButtonDblClick: