Skip to content

Commit a4a40af

Browse files
author
jef
committedNov 9, 2008

20 files changed

+140
-140
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,7 @@ void QgisApp::restoreSessionPlugins( QString thePluginDirString )
18471847
{
18481848
QString myFullPath = thePluginDirString + "/" + myPluginDir[i];
18491849

1850-
QString baseName = QFileInfo(myFullPath).baseName();
1850+
QString baseName = QFileInfo( myFullPath ).baseName();
18511851
QLibrary *myLib = new QLibrary( myFullPath );
18521852
bool loaded = myLib->load();
18531853
if ( loaded )
@@ -1859,7 +1859,7 @@ void QgisApp::restoreSessionPlugins( QString thePluginDirString )
18591859
if ( myName && myDescription && myVersion )
18601860
{
18611861
//check if the plugin was active on last session
1862-
1862+
18631863
// Windows stores a "true" value as a 1 in the registry so we
18641864
// have to use readBoolEntry in this function
18651865

@@ -4210,17 +4210,17 @@ void QgisApp::loadPythonPlugin( QString packageName, QString pluginName )
42104210

42114211

42124212
QgsPluginRegistry *pRegistry = QgsPluginRegistry::instance();
4213-
4213+
42144214
// is loaded already?
4215-
if ( ! pRegistry->isLoaded(packageName) )
4215+
if ( ! pRegistry->isLoaded( packageName ) )
42164216
{
42174217
mPythonUtils->loadPlugin( packageName );
42184218
mPythonUtils->startPlugin( packageName );
42194219

42204220
// TODO: test success
42214221

42224222
// add to plugin registry
4223-
pRegistry->addPlugin( packageName, QgsPluginMetadata( packageName, pluginName, NULL, true) );
4223+
pRegistry->addPlugin( packageName, QgsPluginMetadata( packageName, pluginName, NULL, true ) );
42244224

42254225
// add to settings
42264226
QSettings settings;
@@ -4236,10 +4236,10 @@ void QgisApp::loadPlugin( QString theFullPathName, QString name )
42364236
QSettings settings;
42374237
// first check to see if its already loaded
42384238
QgsPluginRegistry *pRegistry = QgsPluginRegistry::instance();
4239-
4240-
QString baseName = QFileInfo(theFullPathName).baseName();
4241-
4242-
if ( pRegistry->isLoaded(baseName) )
4239+
4240+
QString baseName = QFileInfo( theFullPathName ).baseName();
4241+
4242+
if ( pRegistry->isLoaded( baseName ) )
42434243
{
42444244
// plugin is loaded
42454245
// QMessageBox::warning(this, "Already Loaded", description + " is already loaded");
@@ -4272,7 +4272,7 @@ void QgisApp::loadPlugin( QString theFullPathName, QString name )
42724272
{
42734273
pl->initGui();
42744274
// add it to the plugin registry
4275-
pRegistry->addPlugin(baseName, QgsPluginMetadata(myLib->fileName(), name, pl) );
4275+
pRegistry->addPlugin( baseName, QgsPluginMetadata( myLib->fileName(), name, pl ) );
42764276
//add it to the qsettings file [ts]
42774277
settings.setValue( "/Plugins/" + baseName, true );
42784278
}

‎src/app/qgsmaptoolmovefeature.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void QgsMapToolMoveFeature::canvasPressEvent( QMouseEvent * e )
7373
QSettings settings;
7474
double searchRadius = settings.value( "/qgis/digitizing/search_radius_vertex_edit", 10 ).toDouble();
7575
QgsRectangle selectRect( layerCoords.x() - searchRadius, layerCoords.y() - searchRadius,
76-
layerCoords.x() + searchRadius, layerCoords.y() + searchRadius );
76+
layerCoords.x() + searchRadius, layerCoords.y() + searchRadius );
7777

7878
vlayer->select( QgsAttributeList(), selectRect, true );
7979

‎src/app/qgspluginmanager.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ void QgsPluginManager::getPythonPluginDescriptions()
167167

168168
// check to see if the plugin is loaded and set the checkbox accordingly
169169
QgsPluginRegistry *pRegistry = QgsPluginRegistry::instance();
170-
if ( pRegistry->isLoaded(packageName) && pRegistry->isPythonPlugin(packageName) )
170+
if ( pRegistry->isLoaded( packageName ) && pRegistry->isPythonPlugin( packageName ) )
171171
{
172172
QgsDebugMsg( "Found plugin in the registry" );
173173
// set the checkbox
@@ -293,11 +293,11 @@ void QgsPluginManager::getPluginDescriptions()
293293
delete myLib;
294294
continue;
295295
}
296-
296+
297297
QString pluginName = pName();
298298
QString pluginDesc = pDesc();
299299
QString pluginVersion = pVersion();
300-
QString baseName = QFileInfo(lib).baseName();
300+
QString baseName = QFileInfo( lib ).baseName();
301301

302302
QString myLibraryName = pluginDir[i];
303303
// filtering will be done on the display role so give it name and desription
@@ -318,15 +318,15 @@ void QgsPluginManager::getPluginDescriptions()
318318
QgsPluginRegistry *pRegistry = QgsPluginRegistry::instance();
319319

320320
// get the library using the plugin description
321-
if ( !pRegistry->isLoaded(baseName) )
321+
if ( !pRegistry->isLoaded( baseName ) )
322322
{
323323
QgsDebugMsg( "Couldn't find plugin in the registry" );
324324
}
325325
else
326326
{
327327
QgsDebugMsg( "Found plugin in the registry" );
328328
// TODO: this check shouldn't be necessary, plugin base names must be unique
329-
if ( pRegistry->library(baseName) == myLib->fileName() )
329+
if ( pRegistry->library( baseName ) == myLib->fileName() )
330330
{
331331
// set the checkbox
332332
myData.setChecked( true );
@@ -363,12 +363,12 @@ void QgsPluginManager::unload()
363363
myIndex = mModelPlugins->index( row, 0 );
364364
// its off -- see if it is loaded and if so, unload it
365365
QgsPluginRegistry *pRegistry = QgsPluginRegistry::instance();
366-
366+
367367
// is loaded?
368368
QString baseName = mModelPlugins->data( myIndex, PLUGIN_BASE_NAME_ROLE ).toString();
369369
if ( ! pRegistry->isLoaded( baseName ) )
370370
continue;
371-
371+
372372
if ( pRegistry->isPythonPlugin( baseName ) )
373373
{
374374
if ( mPythonUtils && mPythonUtils->isEnabled() )
@@ -471,10 +471,10 @@ void QgsPluginManager::on_vwPlugins_clicked( const QModelIndex &theIndex )
471471
// the index row in the underlying model so we need to jump through this
472472
// little hoop to get the correct item
473473
//
474-
475-
QModelIndex realIndex = mModelProxy->mapToSource(theIndex);
476-
QStandardItem* mypItem = mModelPlugins->itemFromIndex(realIndex);
477-
QgsDetailedItemData myData =
474+
475+
QModelIndex realIndex = mModelProxy->mapToSource( theIndex );
476+
QStandardItem* mypItem = mModelPlugins->itemFromIndex( realIndex );
477+
QgsDetailedItemData myData =
478478
qVariantValue<QgsDetailedItemData>( mypItem->data( PLUGIN_DATA_ROLE ) );
479479
if ( myData.isChecked() )
480480
{

‎src/app/qgspluginregistry.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,62 +46,62 @@ void QgsPluginRegistry::setPythonUtils( QgsPythonUtils* pythonUtils )
4646

4747
bool QgsPluginRegistry::isLoaded( QString key )
4848
{
49-
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
50-
return (it != mPlugins.end());
49+
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find( key );
50+
return ( it != mPlugins.end() );
5151
}
5252

5353
QString QgsPluginRegistry::library( QString key )
5454
{
55-
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
56-
if (it == mPlugins.end())
55+
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find( key );
56+
if ( it == mPlugins.end() )
5757
return QString();
58-
58+
5959
return it->library();
6060
}
6161

6262
QgisPlugin *QgsPluginRegistry::plugin( QString key )
6363
{
64-
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
65-
if (it == mPlugins.end())
64+
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find( key );
65+
if ( it == mPlugins.end() )
6666
return NULL;
67-
67+
6868
return it->plugin();
6969
}
7070

7171
bool QgsPluginRegistry::isPythonPlugin( QString key )
7272
{
73-
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
74-
if (it == mPlugins.end())
73+
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find( key );
74+
if ( it == mPlugins.end() )
7575
return false;
7676
return it->isPython();
7777
}
7878

7979
void QgsPluginRegistry::addPlugin( QString key, QgsPluginMetadata metadata )
8080
{
81-
mPlugins.insert(key, metadata);
81+
mPlugins.insert( key, metadata );
8282
}
8383

8484
void QgsPluginRegistry::dump()
8585
{
86-
QgsDebugMsg("PLUGINS IN REGISTRY: key -> (name, library, isPython)");
86+
QgsDebugMsg( "PLUGINS IN REGISTRY: key -> (name, library, isPython)" );
8787
for ( QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.begin();
8888
it != mPlugins.end();
8989
it++ )
9090
{
91-
QgsDebugMsg(QString("PLUGIN: %1 -> (%2, %3, %4)")
92-
.arg(it.key())
93-
.arg(it->name())
94-
.arg(it->library())
95-
.arg(it->isPython()));
91+
QgsDebugMsg( QString( "PLUGIN: %1 -> (%2, %3, %4)" )
92+
.arg( it.key() )
93+
.arg( it->name() )
94+
.arg( it->library() )
95+
.arg( it->isPython() ) );
9696
}
9797
}
9898

9999

100100
void QgsPluginRegistry::removePlugin( QString key )
101101
{
102-
QgsDebugMsg("removing plugin: "+key);
103-
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
104-
if (it != mPlugins.end())
102+
QgsDebugMsg( "removing plugin: " + key );
103+
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find( key );
104+
if ( it != mPlugins.end() )
105105
{
106106
mPlugins.erase( it );
107107
}
@@ -113,10 +113,10 @@ void QgsPluginRegistry::unloadAll()
113113
it != mPlugins.end();
114114
it++ )
115115
{
116-
if (isPythonPlugin(it.key()))
116+
if ( isPythonPlugin( it.key() ) )
117117
{
118-
if (mPythonUtils)
119-
mPythonUtils->unloadPlugin(it->library());
118+
if ( mPythonUtils )
119+
mPythonUtils->unloadPlugin( it->library() );
120120
else
121121
QgsDebugMsg( "warning: python utils is NULL" );
122122
}
@@ -125,7 +125,7 @@ void QgsPluginRegistry::unloadAll()
125125
if ( it->plugin() )
126126
it->plugin()->unload();
127127
else
128-
QgsDebugMsg("warning: plugin is NULL:" + it.key());
128+
QgsDebugMsg( "warning: plugin is NULL:" + it.key() );
129129
}
130130
}
131131
}

‎src/app/qgspluginregistry.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,38 +41,38 @@ class QgsPluginRegistry
4141
public:
4242
//! Returns the instance pointer, creating the object on the first call
4343
static QgsPluginRegistry* instance();
44-
44+
4545
//! Check whether this module is loaded
4646
bool isLoaded( QString key );
47-
47+
4848
//! Retrieve library of the plugin
4949
QString library( QString key );
50-
50+
5151
//! Retrieve a pointer to a loaded plugin
5252
QgisPlugin * plugin( QString key );
53-
53+
5454
//! Return whether the plugin is pythonic
5555
bool isPythonPlugin( QString key );
56-
56+
5757
//! Add a plugin to the map of loaded plugins
5858
void addPlugin( QString key, QgsPluginMetadata metadata );
59-
59+
6060
//! Remove a plugin from the list of loaded plugins
6161
void removePlugin( QString key );
62-
62+
6363
//! Unload plugins
6464
void unloadAll();
65-
65+
6666
//! Save pointer for python utils (needed for unloading python plugins)
6767
void setPythonUtils( QgsPythonUtils* pythonUtils );
68-
68+
6969
//! Dump list of plugins
7070
void dump();
71-
71+
7272
protected:
7373
//! protected constructor
7474
QgsPluginRegistry();
75-
75+
7676
private:
7777
static QgsPluginRegistry* _instance;
7878
QMap<QString, QgsPluginMetadata> mPlugins;

‎src/app/qgspythondialog.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,42 +45,42 @@ QString QgsPythonDialog::escapeHtml( QString text )
4545

4646
void QgsPythonDialog::keyPressEvent( QKeyEvent *ev )
4747
{
48-
switch( ev->key() )
48+
switch ( ev->key() )
4949
{
50-
case Qt::Key_Up:
50+
case Qt::Key_Up:
5151
{
52-
if(pos>0)
52+
if ( pos > 0 )
5353
{
54-
if( pos==history.size() )
54+
if ( pos == history.size() )
5555
history << edtCmdLine->text();
5656
else
5757
history[pos] = edtCmdLine->text();
5858
pos--;
59-
edtCmdLine->setText(history[pos]);
59+
edtCmdLine->setText( history[pos] );
6060
}
6161
}
6262
break;
63-
case Qt::Key_Down:
63+
case Qt::Key_Down:
6464
{
65-
if( pos<history.size()-1 )
65+
if ( pos < history.size() - 1 )
6666
{
6767
history[pos] = edtCmdLine->text();
6868
pos++;
69-
edtCmdLine->setText(history[pos]);
69+
edtCmdLine->setText( history[pos] );
7070
}
7171
}
7272
break;
73-
default:
74-
QWidget::keyPressEvent(ev);
75-
break;
73+
default:
74+
QWidget::keyPressEvent( ev );
75+
break;
7676
}
7777
}
7878

7979
void QgsPythonDialog::on_edtCmdLine_returnPressed()
8080
{
8181
QString command = edtCmdLine->text();
8282

83-
if( !command.isEmpty() )
83+
if ( !command.isEmpty() )
8484
{
8585
history << command;
8686
pos = history.size();

‎src/core/qgsgeometry.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ class CORE_EXPORT QgsGeometry
276276
/** Returns a geometry representing the points shared by this geometry and other. */
277277
QgsGeometry* intersection( QgsGeometry* geometry );
278278

279-
/** Returns a geometry representing all the points in this geometry and other (a
280-
* union geometry operation).
279+
/** Returns a geometry representing all the points in this geometry and other (a
280+
* union geometry operation).
281281
* @note this operation is not called union since its a reserved word in C++.*/
282282
QgsGeometry* combine( QgsGeometry* geometry );
283283

0 commit comments

Comments
 (0)
Please sign in to comment.