Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
automatic indentation update (r9447-r9610)
git-svn-id: http://svn.osgeo.org/qgis/trunk@9611 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 9, 2008
1 parent b40ceb2 commit 5fb69d1
Show file tree
Hide file tree
Showing 20 changed files with 140 additions and 140 deletions.
20 changes: 10 additions & 10 deletions src/app/qgisapp.cpp
Expand Up @@ -1847,7 +1847,7 @@ void QgisApp::restoreSessionPlugins( QString thePluginDirString )
{
QString myFullPath = thePluginDirString + "/" + myPluginDir[i];

QString baseName = QFileInfo(myFullPath).baseName();
QString baseName = QFileInfo( myFullPath ).baseName();
QLibrary *myLib = new QLibrary( myFullPath );
bool loaded = myLib->load();
if ( loaded )
Expand All @@ -1859,7 +1859,7 @@ void QgisApp::restoreSessionPlugins( QString thePluginDirString )
if ( myName && myDescription && myVersion )
{
//check if the plugin was active on last session

// Windows stores a "true" value as a 1 in the registry so we
// have to use readBoolEntry in this function

Expand Down Expand Up @@ -4210,17 +4210,17 @@ void QgisApp::loadPythonPlugin( QString packageName, QString pluginName )


QgsPluginRegistry *pRegistry = QgsPluginRegistry::instance();

// is loaded already?
if ( ! pRegistry->isLoaded(packageName) )
if ( ! pRegistry->isLoaded( packageName ) )
{
mPythonUtils->loadPlugin( packageName );
mPythonUtils->startPlugin( packageName );

// TODO: test success

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

// add to settings
QSettings settings;
Expand All @@ -4236,10 +4236,10 @@ void QgisApp::loadPlugin( QString theFullPathName, QString name )
QSettings settings;
// first check to see if its already loaded
QgsPluginRegistry *pRegistry = QgsPluginRegistry::instance();
QString baseName = QFileInfo(theFullPathName).baseName();
if ( pRegistry->isLoaded(baseName) )

QString baseName = QFileInfo( theFullPathName ).baseName();

if ( pRegistry->isLoaded( baseName ) )
{
// plugin is loaded
// QMessageBox::warning(this, "Already Loaded", description + " is already loaded");
Expand Down Expand Up @@ -4272,7 +4272,7 @@ void QgisApp::loadPlugin( QString theFullPathName, QString name )
{
pl->initGui();
// add it to the plugin registry
pRegistry->addPlugin(baseName, QgsPluginMetadata(myLib->fileName(), name, pl) );
pRegistry->addPlugin( baseName, QgsPluginMetadata( myLib->fileName(), name, pl ) );
//add it to the qsettings file [ts]
settings.setValue( "/Plugins/" + baseName, true );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolmovefeature.cpp
Expand Up @@ -73,7 +73,7 @@ void QgsMapToolMoveFeature::canvasPressEvent( QMouseEvent * e )
QSettings settings;
double searchRadius = settings.value( "/qgis/digitizing/search_radius_vertex_edit", 10 ).toDouble();
QgsRectangle selectRect( layerCoords.x() - searchRadius, layerCoords.y() - searchRadius,
layerCoords.x() + searchRadius, layerCoords.y() + searchRadius );
layerCoords.x() + searchRadius, layerCoords.y() + searchRadius );

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

Expand Down
22 changes: 11 additions & 11 deletions src/app/qgspluginmanager.cpp
Expand Up @@ -167,7 +167,7 @@ void QgsPluginManager::getPythonPluginDescriptions()

// check to see if the plugin is loaded and set the checkbox accordingly
QgsPluginRegistry *pRegistry = QgsPluginRegistry::instance();
if ( pRegistry->isLoaded(packageName) && pRegistry->isPythonPlugin(packageName) )
if ( pRegistry->isLoaded( packageName ) && pRegistry->isPythonPlugin( packageName ) )
{
QgsDebugMsg( "Found plugin in the registry" );
// set the checkbox
Expand Down Expand Up @@ -293,11 +293,11 @@ void QgsPluginManager::getPluginDescriptions()
delete myLib;
continue;
}

QString pluginName = pName();
QString pluginDesc = pDesc();
QString pluginVersion = pVersion();
QString baseName = QFileInfo(lib).baseName();
QString baseName = QFileInfo( lib ).baseName();

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

// get the library using the plugin description
if ( !pRegistry->isLoaded(baseName) )
if ( !pRegistry->isLoaded( baseName ) )
{
QgsDebugMsg( "Couldn't find plugin in the registry" );
}
else
{
QgsDebugMsg( "Found plugin in the registry" );
// TODO: this check shouldn't be necessary, plugin base names must be unique
if ( pRegistry->library(baseName) == myLib->fileName() )
if ( pRegistry->library( baseName ) == myLib->fileName() )
{
// set the checkbox
myData.setChecked( true );
Expand Down Expand Up @@ -363,12 +363,12 @@ void QgsPluginManager::unload()
myIndex = mModelPlugins->index( row, 0 );
// its off -- see if it is loaded and if so, unload it
QgsPluginRegistry *pRegistry = QgsPluginRegistry::instance();

// is loaded?
QString baseName = mModelPlugins->data( myIndex, PLUGIN_BASE_NAME_ROLE ).toString();
if ( ! pRegistry->isLoaded( baseName ) )
continue;

if ( pRegistry->isPythonPlugin( baseName ) )
{
if ( mPythonUtils && mPythonUtils->isEnabled() )
Expand Down Expand Up @@ -471,10 +471,10 @@ void QgsPluginManager::on_vwPlugins_clicked( const QModelIndex &theIndex )
// the index row in the underlying model so we need to jump through this
// little hoop to get the correct item
//
QModelIndex realIndex = mModelProxy->mapToSource(theIndex);
QStandardItem* mypItem = mModelPlugins->itemFromIndex(realIndex);
QgsDetailedItemData myData =

QModelIndex realIndex = mModelProxy->mapToSource( theIndex );
QStandardItem* mypItem = mModelPlugins->itemFromIndex( realIndex );
QgsDetailedItemData myData =
qVariantValue<QgsDetailedItemData>( mypItem->data( PLUGIN_DATA_ROLE ) );
if ( myData.isChecked() )
{
Expand Down
48 changes: 24 additions & 24 deletions src/app/qgspluginregistry.cpp
Expand Up @@ -46,62 +46,62 @@ void QgsPluginRegistry::setPythonUtils( QgsPythonUtils* pythonUtils )

bool QgsPluginRegistry::isLoaded( QString key )
{
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
return (it != mPlugins.end());
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find( key );
return ( it != mPlugins.end() );
}

QString QgsPluginRegistry::library( QString key )
{
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
if (it == mPlugins.end())
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find( key );
if ( it == mPlugins.end() )
return QString();

return it->library();
}

QgisPlugin *QgsPluginRegistry::plugin( QString key )
{
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
if (it == mPlugins.end())
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find( key );
if ( it == mPlugins.end() )
return NULL;

return it->plugin();
}

bool QgsPluginRegistry::isPythonPlugin( QString key )
{
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
if (it == mPlugins.end())
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find( key );
if ( it == mPlugins.end() )
return false;
return it->isPython();
}

void QgsPluginRegistry::addPlugin( QString key, QgsPluginMetadata metadata )
{
mPlugins.insert(key, metadata);
mPlugins.insert( key, metadata );
}

void QgsPluginRegistry::dump()
{
QgsDebugMsg("PLUGINS IN REGISTRY: key -> (name, library, isPython)");
QgsDebugMsg( "PLUGINS IN REGISTRY: key -> (name, library, isPython)" );
for ( QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.begin();
it != mPlugins.end();
it++ )
{
QgsDebugMsg(QString("PLUGIN: %1 -> (%2, %3, %4)")
.arg(it.key())
.arg(it->name())
.arg(it->library())
.arg(it->isPython()));
QgsDebugMsg( QString( "PLUGIN: %1 -> (%2, %3, %4)" )
.arg( it.key() )
.arg( it->name() )
.arg( it->library() )
.arg( it->isPython() ) );
}
}


void QgsPluginRegistry::removePlugin( QString key )
{
QgsDebugMsg("removing plugin: "+key);
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find(key);
if (it != mPlugins.end())
QgsDebugMsg( "removing plugin: " + key );
QMap<QString, QgsPluginMetadata>::iterator it = mPlugins.find( key );
if ( it != mPlugins.end() )
{
mPlugins.erase( it );
}
Expand All @@ -113,10 +113,10 @@ void QgsPluginRegistry::unloadAll()
it != mPlugins.end();
it++ )
{
if (isPythonPlugin(it.key()))
if ( isPythonPlugin( it.key() ) )
{
if (mPythonUtils)
mPythonUtils->unloadPlugin(it->library());
if ( mPythonUtils )
mPythonUtils->unloadPlugin( it->library() );
else
QgsDebugMsg( "warning: python utils is NULL" );
}
Expand All @@ -125,7 +125,7 @@ void QgsPluginRegistry::unloadAll()
if ( it->plugin() )
it->plugin()->unload();
else
QgsDebugMsg("warning: plugin is NULL:" + it.key());
QgsDebugMsg( "warning: plugin is NULL:" + it.key() );
}
}
}
22 changes: 11 additions & 11 deletions src/app/qgspluginregistry.h
Expand Up @@ -41,38 +41,38 @@ class QgsPluginRegistry
public:
//! Returns the instance pointer, creating the object on the first call
static QgsPluginRegistry* instance();

//! Check whether this module is loaded
bool isLoaded( QString key );

//! Retrieve library of the plugin
QString library( QString key );

//! Retrieve a pointer to a loaded plugin
QgisPlugin * plugin( QString key );

//! Return whether the plugin is pythonic
bool isPythonPlugin( QString key );

//! Add a plugin to the map of loaded plugins
void addPlugin( QString key, QgsPluginMetadata metadata );

//! Remove a plugin from the list of loaded plugins
void removePlugin( QString key );

//! Unload plugins
void unloadAll();

//! Save pointer for python utils (needed for unloading python plugins)
void setPythonUtils( QgsPythonUtils* pythonUtils );

//! Dump list of plugins
void dump();

protected:
//! protected constructor
QgsPluginRegistry();

private:
static QgsPluginRegistry* _instance;
QMap<QString, QgsPluginMetadata> mPlugins;
Expand Down
24 changes: 12 additions & 12 deletions src/app/qgspythondialog.cpp
Expand Up @@ -45,42 +45,42 @@ QString QgsPythonDialog::escapeHtml( QString text )

void QgsPythonDialog::keyPressEvent( QKeyEvent *ev )
{
switch( ev->key() )
switch ( ev->key() )
{
case Qt::Key_Up:
case Qt::Key_Up:
{
if(pos>0)
if ( pos > 0 )
{
if( pos==history.size() )
if ( pos == history.size() )
history << edtCmdLine->text();
else
history[pos] = edtCmdLine->text();
pos--;
edtCmdLine->setText(history[pos]);
edtCmdLine->setText( history[pos] );
}
}
break;
case Qt::Key_Down:
case Qt::Key_Down:
{
if( pos<history.size()-1 )
if ( pos < history.size() - 1 )
{
history[pos] = edtCmdLine->text();
pos++;
edtCmdLine->setText(history[pos]);
edtCmdLine->setText( history[pos] );
}
}
break;
default:
QWidget::keyPressEvent(ev);
break;
default:
QWidget::keyPressEvent( ev );
break;
}
}

void QgsPythonDialog::on_edtCmdLine_returnPressed()
{
QString command = edtCmdLine->text();

if( !command.isEmpty() )
if ( !command.isEmpty() )
{
history << command;
pos = history.size();
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsgeometry.h
Expand Up @@ -276,8 +276,8 @@ class CORE_EXPORT QgsGeometry
/** Returns a geometry representing the points shared by this geometry and other. */
QgsGeometry* intersection( QgsGeometry* geometry );

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

Expand Down

0 comments on commit 5fb69d1

Please sign in to comment.