Skip to content

Commit 772cd0c

Browse files
committedAug 19, 2015
Indentation fixes
1 parent 10dfb5b commit 772cd0c

File tree

7 files changed

+59
-54
lines changed

7 files changed

+59
-54
lines changed
 

‎doc/whatsnew.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
html {
66
font-family: "Open Sans", "Helvetica Neue", Ubuntu, Arial, sans-serif;
77
}
8+
body {
9+
font-size: 80%;
10+
}
811
a {
912
text-decoration: none;
1013
color: #08c;

‎src/app/qgisapp.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ void QgisApp::readSettings()
11581158

11591159

11601160

1161-
Q_FOREACH( const QString& key, projectKeys )
1161+
Q_FOREACH ( const QString& key, projectKeys )
11621162
{
11631163
QgsWelcomePageItemsModel::RecentProjectData data;
11641164
settings.beginGroup( key );
@@ -2719,7 +2719,7 @@ void QgisApp::updateRecentProjectPaths()
27192719
{
27202720
mRecentProjectsMenu->clear();
27212721

2722-
Q_FOREACH( const QgsWelcomePageItemsModel::RecentProjectData& recentProject, mRecentProjects )
2722+
Q_FOREACH ( const QgsWelcomePageItemsModel::RecentProjectData& recentProject, mRecentProjects )
27232723
{
27242724
QAction* action = mRecentProjectsMenu->addAction( QString( "%1 (%2)" ).arg( recentProject.title ).arg( recentProject.path ) );
27252725
action->setEnabled( QFile::exists(( recentProject.path ) ) );
@@ -2745,16 +2745,16 @@ void QgisApp::saveRecentProjectPath( QString projectPath, bool savePreviewImage
27452745
if ( savePreviewImage )
27462746
{
27472747
// Generate a unique file name
2748-
QString fileName( QCryptographicHash::hash( ( projectData.path.toUtf8() ), QCryptographicHash::Md5 ).toHex() );
2748+
QString fileName( QCryptographicHash::hash(( projectData.path.toUtf8() ), QCryptographicHash::Md5 ).toHex() );
27492749
QString previewDir = QString( "%1/previewImages" ).arg( QgsApplication::qgisSettingsDirPath() );
27502750
projectData.previewImagePath = QString( "%1/%2.png" ).arg( previewDir ).arg( fileName );
27512751
QDir().mkdir( previewDir );
27522752

27532753
// Render the map canvas
27542754
QSize previewSize( 250, 177 ); // h = w / sqrt(2)
2755-
QRect previewRect( QPoint( ( mMapCanvas->width() - previewSize.width() ) / 2
2756-
, ( mMapCanvas->height() - previewSize.height() ) / 2 )
2757-
, previewSize );
2755+
QRect previewRect( QPoint(( mMapCanvas->width() - previewSize.width() ) / 2
2756+
, ( mMapCanvas->height() - previewSize.height() ) / 2 )
2757+
, previewSize );
27582758

27592759
QPixmap previewImage( previewSize );
27602760
QPainter previewPainter( &previewImage );
@@ -2787,7 +2787,7 @@ void QgisApp::saveRecentProjectPath( QString projectPath, bool savePreviewImage
27872787
int idx = 0;
27882788

27892789
// Persist the list
2790-
Q_FOREACH( const QgsWelcomePageItemsModel::RecentProjectData& recentProject, mRecentProjects )
2790+
Q_FOREACH ( const QgsWelcomePageItemsModel::RecentProjectData& recentProject, mRecentProjects )
27912791
{
27922792
++idx;
27932793
settings.beginGroup( QString( "/UI/recentProjects/%1" ).arg( idx ) );
@@ -7754,7 +7754,7 @@ void QgisApp::checkQgisVersion()
77547754
QgsVersionInfo* versionInfo = new QgsVersionInfo();
77557755
QApplication::setOverrideCursor( Qt::WaitCursor );
77567756

7757-
connect( versionInfo, SIGNAL(versionInfoAvailable()), this, SLOT(versionReplyFinished()));
7757+
connect( versionInfo, SIGNAL( versionInfoAvailable() ), this, SLOT( versionReplyFinished() ) );
77587758
versionInfo->checkVersion();
77597759
}
77607760

@@ -7765,7 +7765,7 @@ void QgisApp::versionReplyFinished()
77657765
QgsVersionInfo* versionInfo = qobject_cast<QgsVersionInfo*>( sender() );
77667766
Q_ASSERT( versionInfo );
77677767

7768-
if( versionInfo->error() == QNetworkReply::NoError )
7768+
if ( versionInfo->error() == QNetworkReply::NoError )
77697769
{
77707770
QString info;
77717771

‎src/app/qgisapp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
480480
static LONG WINAPI qgisCrashDump( struct _EXCEPTION_POINTERS *ExceptionInfo );
481481
#endif
482482

483-
void parseVersionInfo(QNetworkReply* reply, int& latestVersion, QStringList& versionInfo );
483+
void parseVersionInfo( QNetworkReply* reply, int& latestVersion, QStringList& versionInfo );
484484

485485
public slots:
486486
void layerTreeViewDoubleClicked( const QModelIndex& index );

‎src/app/qgswelcomepage.cpp

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <QDesktopServices>
2727

2828
QgsWelcomePage::QgsWelcomePage( QWidget* parent )
29-
: QWidget( parent )
29+
: QWidget( parent )
3030
{
3131
QVBoxLayout* mainLayout = new QVBoxLayout;
3232
mainLayout->setMargin( 0 );
@@ -39,60 +39,61 @@ QgsWelcomePage::QgsWelcomePage( QWidget* parent )
3939

4040
QWidget* recentProjctsContainer = new QWidget;
4141
recentProjctsContainer->setLayout( new QVBoxLayout );
42-
QLabel* recentProjectsTitle = new QLabel( QString( "<h1>%1</h1>").arg( tr( "Recent Projects" ) ) );
42+
QLabel* recentProjectsTitle = new QLabel( QString( "<h1>%1</h1>" ).arg( tr( "Recent Projects" ) ) );
4343
recentProjctsContainer->layout()->addWidget( recentProjectsTitle );
4444

45-
QListView* welcomeScreenListView = new QListView();
46-
mModel = new QgsWelcomePageItemsModel( welcomeScreenListView );
47-
welcomeScreenListView->setModel( mModel );
48-
welcomeScreenListView->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::MinimumExpanding );
49-
welcomeScreenListView->setStyleSheet( "QListView::item {"
50-
" margin-top: 5px;"
51-
" margin-bottom: 5px;"
52-
" margin-left: 15px;"
53-
" margin-right: 15px;"
54-
" border-width: 1px;"
55-
" border-color: #999;"
56-
" border-radius: 9px;"
57-
" background: #eee;"
58-
" padding: 10px;"
59-
"}"
60-
"QListView::item:selected:active {"
61-
" background: #aaaaaa;"
62-
"}");
63-
64-
recentProjctsContainer->layout()->addWidget( welcomeScreenListView );
45+
QListView* recentProjectsListView = new QListView();
46+
mModel = new QgsWelcomePageItemsModel( recentProjectsListView );
47+
recentProjectsListView->setModel( mModel );
48+
recentProjectsListView->setStyleSheet( "QListView::item {"
49+
" margin-top: 5px;"
50+
" margin-bottom: 5px;"
51+
" margin-left: 15px;"
52+
" margin-right: 15px;"
53+
" border-width: 1px;"
54+
" border-color: #999;"
55+
" border-radius: 9px;"
56+
" background: #eee;"
57+
" padding: 10px;"
58+
"}"
59+
"QListView::item:selected:active {"
60+
" background: #aaaaaa;"
61+
"}" );
62+
63+
recentProjctsContainer->layout()->addWidget( recentProjectsListView );
6564

6665
layout->addWidget( recentProjctsContainer );
6766

6867
QWidget* whatsNewContainer = new QWidget;
6968
whatsNewContainer->setLayout( new QVBoxLayout );
70-
QLabel* whatsNewTitle = new QLabel( QString( "<h1>%1</h1>").arg( tr( "QGIS News" ) ) );
69+
QLabel* whatsNewTitle = new QLabel( QString( "<h1>%1</h1>" ).arg( tr( "QGIS News" ) ) );
7170
whatsNewContainer->layout()->addWidget( whatsNewTitle );
7271

7372
QgsWebView* whatsNewPage = new QgsWebView();
7473
whatsNewPage->setUrl( QUrl::fromLocalFile( QgsApplication::whatsNewFilePath() ) );
7574
whatsNewPage->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
7675
whatsNewPage->setContextMenuPolicy( Qt::NoContextMenu );
77-
whatsNewPage->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::MinimumExpanding );
76+
whatsNewPage->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding );
7877

7978
whatsNewContainer->layout()->addWidget( whatsNewPage );
79+
whatsNewContainer->setMaximumWidth( 250 );
80+
whatsNewContainer->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
8081
layout->addWidget( whatsNewContainer );
8182

82-
connect( whatsNewPage, SIGNAL(linkClicked(QUrl)), this, SLOT(whatsNewLinkClicked(QUrl)));
83+
connect( whatsNewPage, SIGNAL( linkClicked( QUrl ) ), this, SLOT( whatsNewLinkClicked( QUrl ) ) );
8384

8485
mVersionInformation = new QLabel;
8586
mainLayout->addWidget( mVersionInformation );
8687
mVersionInformation->setVisible( false );
8788

8889
QgsVersionInfo* versionInfo = new QgsVersionInfo();
89-
connect( versionInfo, SIGNAL(versionInfoAvailable()), this, SLOT(versionInfoReceived()));
90+
connect( versionInfo, SIGNAL( versionInfoAvailable() ), this, SLOT( versionInfoReceived() ) );
9091
versionInfo->checkVersion();
9192

92-
connect( welcomeScreenListView, SIGNAL( doubleClicked( QModelIndex ) ), this, SLOT( itemDoubleClicked( QModelIndex ) ) );
93+
connect( recentProjectsListView, SIGNAL( doubleClicked( QModelIndex ) ), this, SLOT( itemDoubleClicked( QModelIndex ) ) );
9394
}
9495

95-
void QgsWelcomePage::setRecentProjects(const QList<QgsWelcomePageItemsModel::RecentProjectData>& recentProjects)
96+
void QgsWelcomePage::setRecentProjects( const QList<QgsWelcomePageItemsModel::RecentProjectData>& recentProjects )
9697
{
9798
mModel->setRecentProjects( recentProjects );
9899
}
@@ -110,17 +111,17 @@ void QgsWelcomePage::versionInfoReceived()
110111
if ( versionInfo->newVersionAvailable() )
111112
{
112113
mVersionInformation->setVisible( true );
113-
mVersionInformation->setText( QString( "<b>%1</b>: %2")
114+
mVersionInformation->setText( QString( "<b>%1</b>: %2" )
114115
.arg( tr( "There is a new QGIS version available" ) )
115116
.arg( versionInfo->downloadInfo() ) );
116-
mVersionInformation->setStyleSheet("QLabel{"
117-
" background-color: #dddd00;"
118-
" padding: 5px;"
119-
"}");
117+
mVersionInformation->setStyleSheet( "QLabel{"
118+
" background-color: #dddd00;"
119+
" padding: 5px;"
120+
"}" );
120121
}
121122
}
122123

123-
void QgsWelcomePage::whatsNewLinkClicked(const QUrl& url)
124+
void QgsWelcomePage::whatsNewLinkClicked( const QUrl& url )
124125
{
125126
QDesktopServices::openUrl( url );
126127
}

‎src/app/qgswelcomepage.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ class QgsWelcomePage : public QWidget
2626
Q_OBJECT
2727

2828
public:
29-
QgsWelcomePage(QWidget* parent = 0);
29+
QgsWelcomePage( QWidget* parent = 0 );
3030

3131
void setRecentProjects( const QList<QgsWelcomePageItemsModel::RecentProjectData>& recentProjects );
3232

3333
private slots:
34-
void itemDoubleClicked(const QModelIndex& index );
34+
void itemDoubleClicked( const QModelIndex& index );
3535
void versionInfoReceived();
36-
void whatsNewLinkClicked(const QUrl& url );
36+
void whatsNewLinkClicked( const QUrl& url );
3737

3838
private:
3939
QgsWelcomePageItemsModel* mModel;

‎src/app/qgswelcomepageitemsmodel.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,17 @@ class QgsWelcomePageItemsModel : public QAbstractListModel
2424
Q_OBJECT
2525

2626
public:
27-
struct RecentProjectData {
28-
bool operator==( const RecentProjectData& other ) { return other.path == this->path; }
29-
QString path;
30-
QString title;
31-
QString previewImagePath;
27+
struct RecentProjectData
28+
{
29+
bool operator==( const RecentProjectData& other ) { return other.path == this->path; }
30+
QString path;
31+
QString title;
32+
QString previewImagePath;
3233
};
3334

3435
QgsWelcomePageItemsModel( QObject* parent = 0 );
3536

36-
void setRecentProjects(const QList<RecentProjectData>& recentProjects );
37+
void setRecentProjects( const QList<RecentProjectData>& recentProjects );
3738

3839
int rowCount( const QModelIndex& parent ) const;
3940
QVariant data( const QModelIndex& index, int role ) const;

‎src/core/qgsproject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class CORE_EXPORT QgsProject : public QObject
8282
/**
8383
Every project has an associated title string
8484
85-
@deprecated Use @link setTitle @endlink instead.
85+
@deprecated Use setTitle instead.
8686
*/
8787
//@{
8888
Q_DECL_DEPRECATED inline void title( const QString & title ) { setTitle( title ); }

0 commit comments

Comments
 (0)
Please sign in to comment.