Skip to content
Permalink
Browse files

cleanups:

- use QMetaObject instead of RTTI
- no get in getters:
  - QgsDataProvider:
   - getProvider => provider
   - getSelectWidget => selectWidget
   - getFunction => function
   - getLibary => providerLibrary
  - QgsProviderRegistry:
   - getLibrary => providerLibrary
- /* ... */ => #if 0 / #endif
- reindentation
  • Loading branch information
jef-n committed May 23, 2011
1 parent ee6c516 commit 4549d0e19934da43ee17fcfb598c3894c5271147
Showing with 4,071 additions and 3,488 deletions.
  1. +1 −1 python/core/qgsproviderregistry.sip
  2. +9 −9 scripts/astyle-all.sh
  3. +0 −5 src/analysis/interpolation/DualEdgeTriangulation.cc
  4. +1 −1 src/analysis/interpolation/ParametricLine.h
  5. +1 −1 src/app/attributetable/qgsattributetabledialog.cpp
  6. +6 −3 src/app/composer/qgscomposer.cpp
  7. +8 −4 src/app/composer/qgscomposermapwidget.cpp
  8. +3 −2 src/app/legend/qgslegend.cpp
  9. +4 −4 src/app/main.cpp
  10. +21 −18 src/app/qgisapp.cpp
  11. +12 −6 src/app/qgsabout.cpp
  12. +2 −2 src/app/qgsattributeactiondialog.cpp
  13. +4 −2 src/app/qgsconfigureshortcutsdialog.cpp
  14. +296 −278 src/app/qgscustomization.cpp
  15. +22 −22 src/app/qgscustomization.h
  16. +3 −0 src/app/qgsmaptooladdpart.cpp
  17. +2 −1 src/app/qgspluginmanager.cpp
  18. +16 −9 src/app/qgspluginregistry.cpp
  19. +7 −7 src/browser/main.cpp
  20. +122 −115 src/browser/qgsbrowser.cpp
  21. +8 −8 src/browser/qgsbrowser.h
  22. +7 −4 src/browser/qgsbrowsermodel.cpp
  23. +8 −8 src/browser/qgsbrowsermodel.h
  24. +1 −1 src/core/pal/rtree.hpp
  25. +2 −1 src/core/qgsapplication.cpp
  26. +4 −2 src/core/qgscoordinatereferencesystem.cpp
  27. +4 −2 src/core/qgscoordinatetransform.cpp
  28. +20 −10 src/core/qgsdataitem.cpp
  29. +6 −3 src/core/qgsdistancearea.cpp
  30. +1 −1 src/core/qgsmaplayer.h
  31. +5 −3 src/core/qgspallabeling.cpp
  32. +16 −16 src/core/qgsproviderregistry.cpp
  33. +7 −7 src/core/qgsproviderregistry.h
  34. +1 −1 src/core/qgspythonrunner.cpp
  35. +2 −2 src/core/qgspythonrunner.h
  36. +2 −1 src/core/qgsrasterdataprovider.cpp
  37. +35 −22 src/core/qgsrasterprojector.cpp
  38. +1 −1 src/core/qgsrasterprojector.h
  39. +12 −6 src/core/qgsrectangle.cpp
  40. +10 −5 src/core/qgssearchtreenode.cpp
  41. +8 −4 src/core/qgsvectorlayer.cpp
  42. +8 −4 src/core/raster/qgscontrastenhancement.cpp
  43. +12 −6 src/core/raster/qgsrasterlayer.cpp
  44. +6 −3 src/core/symbology-ng/qgscolorbrewerpalette.h
  45. +4 −2 src/core/symbology-ng/qgsfillsymbollayerv2.cpp
  46. +4 −2 src/core/symbology-ng/qgslinesymbollayerv2.cpp
  47. +4 −2 src/core/symbology-ng/qgssinglesymbolrendererv2.cpp
  48. +2 −1 src/core/symbology-ng/qgssymbollayerv2utils.cpp
  49. +2 −1 src/core/symbology-ng/qgsvectorcolorrampv2.cpp
  50. +2 −1 src/core/symbology/qgsmarkercatalogue.cpp
  51. +0 −1 src/gui/CMakeLists.txt
  52. +1 −1 src/gui/attributetable/qgsattributetableview.cpp
  53. +4 −2 src/gui/qgsdetaileditemdelegate.cpp
  54. +1 −1 src/gui/qgsdetaileditemdelegate.h
  55. +1 −1 src/gui/qgsdetaileditemwidget.h
  56. +34 −17 src/gui/qgsmanageconnectionsdialog.cpp
  57. +2 −1 src/gui/qgsmapcanvas.cpp
  58. +12 −6 src/gui/qgsmapoverviewcanvas.cpp
  59. +6 −9 src/gui/qgsquickprint.cpp
  60. +14 −7 src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp
  61. +18 −9 src/gui/symbology-ng/qgsstylev2exportimportdialog.cpp
  62. +23 −8 src/gui/symbology-ng/qgsstylev2managerdialog.cpp
  63. +9 −8 src/gui/symbology-ng/qgssymbolv2propertiesdialog.cpp
  64. +3 −3 src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp
  65. +2 −2 src/mapserver/qgis_map_serv.cpp
  66. +4 −4 src/mapserver/qgscapabilitiescache.cpp
  67. +1 −1 src/mapserver/qgscapabilitiescache.h
  68. +8 −4 src/mapserver/qgswmsserver.cpp
  69. +12 −6 src/plugins/delimited_text/qgsdelimitedtextplugingui.cpp
  70. +4 −2 src/plugins/diagram_overlay/qgssvgdiagramfactorywidget.cpp
  71. +14 −7 src/plugins/evis/eventbrowser/evisgenericeventbrowsergui.cpp
  72. +10 −8 src/plugins/evis/idtool/eviseventidtool.cpp
  73. +2 −1 src/plugins/georeferencer/qgsgcplist.cpp
  74. +14 −5 src/plugins/georeferencer/qgsgeorefplugingui.cpp
  75. +6 −4 src/plugins/georeferencer/qgsgeoreftransform.cpp
  76. +15 −9 src/plugins/georeferencer/qgsimagewarper.cpp
  77. +4 −2 src/plugins/georeferencer/qgstransformsettingsdialog.cpp
  78. +4 −8 src/plugins/gps_importer/qgsgpsplugin.cpp
  79. +8 −4 src/plugins/grass/qgsgrassattributes.cpp
  80. +16 −8 src/plugins/grass/qgsgrassbrowser.cpp
  81. +76 −38 src/plugins/grass/qgsgrassedit.cpp
  82. +4 −2 src/plugins/grass/qgsgrassedittools.cpp
  83. +100 −49 src/plugins/grass/qgsgrassmapcalc.cpp
  84. +40 −20 src/plugins/grass/qgsgrassmodel.cpp
  85. +130 −62 src/plugins/grass/qgsgrassmodule.cpp
  86. +2 −2 src/plugins/grass/qgsgrassmodule.h
  87. +46 −23 src/plugins/grass/qgsgrassnewmapset.cpp
  88. +12 −6 src/plugins/grass/qgsgrassplugin.cpp
  89. +22 −11 src/plugins/grass/qgsgrassregion.cpp
  90. +28 −14 src/plugins/grass/qgsgrassselect.cpp
  91. +11 −6 src/plugins/grass/qgsgrasstools.cpp
  92. +6 −7 src/plugins/grass/qgsgrassutils.cpp
  93. +11 −4 src/plugins/scale_bar/plugin.cpp
  94. +4 −1 src/plugins/sqlanywhere/sadbtablemodel.cpp
  95. +2 −1 src/plugins/sqlanywhere/sasourceselect.cpp
  96. +14 −7 src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
  97. +33 −25 src/providers/gdal/qgsgdalprovider.cpp
  98. +3 −3 src/providers/gdal/qgsgdalprovider.h
  99. +4 −2 src/providers/grass/qgis.g.info.c
  100. +35 −18 src/providers/grass/qgsgrass.cpp
  101. +70 −45 src/providers/grass/qgsgrassprovider.cpp
  102. +4 −2 src/providers/grass/qgsgrassrasterprovider.cpp
  103. +4 −2 src/providers/memory/qgsmemoryprovider.cpp
  104. +124 −114 src/providers/ogr/qgsogrprovider.cpp
  105. +4 −4 src/providers/ogr/qgsogrprovider.h
  106. +2,098 −2,098 src/providers/spatialite/qgsspatialiteprovider.cpp
  107. +26 −26 src/providers/spatialite/qgsspatialiteprovider.h
  108. +6 −3 src/providers/sqlanywhere/qgssqlanywhereprovider.cpp
  109. +20 −10 src/providers/sqlanywhere/sqlanyconnection/sqlanyconnection.cpp
  110. +34 −17 src/providers/sqlanywhere/sqlanyconnection/sqlanystatement.cpp
  111. +5 −5 src/providers/wms/qgswmsconnection.cpp
  112. +2 −2 src/providers/wms/qgswmsconnection.h
  113. +56 −52 src/providers/wms/qgswmsprovider.cpp
  114. +13 −13 src/providers/wms/qgswmsprovider.h
  115. +16 −15 src/providers/wms/qgswmssourceselect.cpp
  116. +10 −10 src/providers/wms/qgswmssourceselect.h
@@ -26,7 +26,7 @@ class QgsProviderRegistry

void setLibraryDirectory(const QDir & path);

QgsDataProvider * getProvider( const QString & providerKey,
QgsDataProvider *provider( const QString & providerKey,
const QString & dataSource );

/** Return list of available providers by their keys */
@@ -8,21 +8,21 @@ export elcr="$(tput el)$(tput cr)"

find src -type f -print | while read f; do
case "$f" in
src/core/spatialite/*)
continue
;;

src/core/spatialite/*|src/core/gps/qextserialport/*|src/plugins/grass/qtermwidget/*|src/astyle/*|python/pyspatialite/*|src/providers/sqlanywhere/sqlanyconnection/*)
echo $f skipped
continue
;;

*.cpp|*.h|*.c|*.h|*.cxx|*.hxx|*.c++|*.h++|*.cc|*.hh|*.C|*.H)
*.cpp|*.h|*.c|*.h|*.cxx|*.hxx|*.c++|*.h++|*.cc|*.hh|*.C|*.H|*.hpp)
cmd=astyle.sh
;;

*.ui|*.qgm|*.txt|*.t2t|*.py|*.sip|resources/context_help/*)
cmd="flip -ub"
;;

*.ui|*.qgm|*.txt|*.t2t|*.py|*.sip|resources/context_help/*)
cmd="flip -ub"
;;

*)
echo $f skipped
continue
;;
esac
@@ -1979,7 +1979,6 @@ void DualEdgeTriangulation::ruppertRefinement()

}
while ( actedge != pointingedge );

}
}
}
@@ -2190,9 +2189,6 @@ void DualEdgeTriangulation::ruppertRefinement()

}
while ( actedge != pointingedge );



}
} //end fast method

@@ -2407,7 +2403,6 @@ void DualEdgeTriangulation::ruppertRefinement()

}
while ( actedge != pointingedge );

}
}

@@ -22,7 +22,7 @@
#include <QVector>

class ANALYSIS_EXPORT ParametricLine
/**ParametricLine is an Interface for parametric lines. It is possible, that a parametric line is composed of several parametric lines (see the composite pattern in Gamma et al. 'Design Patterns'). Do not build instances of it since it is an abstract class.*/
/**ParametricLine is an Interface for parametric lines. It is possible, that a parametric line is composed of several parametric lines (see the composite pattern in Gamma et al. 'Design Patterns'). Do not build instances of it since it is an abstract class.*/
{
protected:
/**Degree of the parametric Line*/
@@ -137,7 +137,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
connect( mView->verticalHeader(), SIGNAL( sectionPressed( int ) ), this, SLOT( updateRowPressed( int ) ) );
connect( mModel, SIGNAL( modelChanged() ), this, SLOT( updateSelection() ) );

connect( mView, SIGNAL(willShowContextMenu( QMenu*, QModelIndex ) ), this, SLOT(viewWillShowContextMenu(QMenu*, QModelIndex ) ) );
connect( mView, SIGNAL( willShowContextMenu( QMenu*, QModelIndex ) ), this, SLOT( viewWillShowContextMenu( QMenu*, QModelIndex ) ) );

mLastClickedHeaderIndex = 0;
mSelectionModel = new QItemSelectionModel( mFilterModel );
@@ -499,7 +499,8 @@ void QgsComposer::on_mActionExportAsPDF_triggered()

int result = myQFileDialog->exec();
raise();
if ( result != QDialog::Accepted ) return;
if ( result != QDialog::Accepted )
return;

QString myOutputFileNameQString = myQFileDialog->selectedFiles().first();
if ( myOutputFileNameQString == "" )
@@ -666,7 +667,8 @@ void QgsComposer::on_mActionExportAsImage_triggered()
QString myFilter = tr( "%1 format (*.%2 *.%3)" )
.arg( myFormat ).arg( myFormat.toLower() ).arg( myFormat.toUpper() );

if ( myCounterInt > 0 ) myFilters += ";;";
if ( myCounterInt > 0 )
myFilters += ";;";
myFilters += myFilter;
myFilterMap[myFilter] = myFormat;
if ( myFormat == myLastUsedFormat )
@@ -799,7 +801,8 @@ void QgsComposer::on_mActionExportAsSVG_triggered()

int result = myQFileDialog->exec();
raise();
if ( result != QDialog::Accepted ) return;
if ( result != QDialog::Accepted )
return;

QString myOutputFileNameQString = myQFileDialog->selectedFiles().first();
if ( myOutputFileNameQString == "" )
@@ -402,13 +402,17 @@ void QgsComposerMapWidget::updateComposerExtentFromGui()
bool conversionSuccess;

xmin = mXMinLineEdit->text().toDouble( &conversionSuccess );
if ( !conversionSuccess ) {return;}
if ( !conversionSuccess )
return;
xmax = mXMaxLineEdit->text().toDouble( &conversionSuccess );
if ( !conversionSuccess ) {return;}
if ( !conversionSuccess )
return;
ymin = mYMinLineEdit->text().toDouble( &conversionSuccess );
if ( !conversionSuccess ) {return;}
if ( !conversionSuccess )
return;
ymax = mYMaxLineEdit->text().toDouble( &conversionSuccess );
if ( !conversionSuccess ) {return;}
if ( !conversionSuccess )
return;

QgsRectangle newExtent( xmin, ymin, xmax, ymax );
mComposerMap->beginCommand( tr( "Map extent changed" ) );
@@ -870,7 +870,8 @@ void QgsLegend::legendLayerShowInOverview()
return;

QgsLegendLayer* ll = qobject_cast<QgsLegendLayer *>( li );
if ( !ll ) return;
if ( !ll )
return;
ll->showInOverview();
}

@@ -1805,7 +1806,7 @@ void QgsLegend::legendLayerZoom()
}
}

if( extent.isEmpty() )
if ( extent.isEmpty() )
{
return;
}
@@ -448,7 +448,7 @@ int main( int argc, char *argv[] )
}

// GUI customization is enabled by default unless --nocustomization argument is used
QgsCustomization::instance()->setEnabled(myCustomization);
QgsCustomization::instance()->setEnabled( myCustomization );

QgsApplication myApp( argc, argv, myUseGuiFlag, configpath );

@@ -624,10 +624,10 @@ int main( int argc, char *argv[] )
QgisApp *qgis = new QgisApp( mypSplash, myRestorePlugins ); // "QgisApp" used to find canonical instance
qgis->setObjectName( "QgisApp" );

myApp.connect (
&myApp, SIGNAL( preNotify( QObject *, QEvent *, bool *)),
myApp.connect(
&myApp, SIGNAL( preNotify( QObject *, QEvent *, bool * ) ),
//qgis, SLOT( preNotify( QObject *, QEvent *))
QgsCustomization::instance(), SLOT( preNotify( QObject *, QEvent *, bool *))
QgsCustomization::instance(), SLOT( preNotify( QObject *, QEvent *, bool * ) )
);

/////////////////////////////////////////////////////////////////////
@@ -983,9 +983,9 @@ void QgisApp::createMenus()

// Panel and Toolbar Submenus
mPanelMenu = new QMenu( tr( "Panels" ) );
mPanelMenu->setObjectName("mPanelMenu");
mPanelMenu->setObjectName( "mPanelMenu" );
mToolbarMenu = new QMenu( tr( "Toolbars" ) );
mToolbarMenu->setObjectName("mToolbarMenu");
mToolbarMenu->setObjectName( "mToolbarMenu" );

// Get platform for menu layout customization (Gnome, Kde, Mac, Win)
QDialogButtonBox::ButtonLayout layout =
@@ -1079,9 +1079,9 @@ void QgisApp::createToolBars()

QList<QAction*> toolbarMenuActions;
// Set action names so that they can be used in customization
foreach ( QToolBar *toolBar, toolbarMenuToolBars )
foreach( QToolBar *toolBar, toolbarMenuToolBars )
{
toolBar->toggleViewAction()->setObjectName ( "mActionToggle" + toolBar->objectName().mid(1) );
toolBar->toggleViewAction()->setObjectName( "mActionToggle" + toolBar->objectName().mid( 1 ) );
toolbarMenuActions << toolBar->toggleViewAction();
}

@@ -2448,16 +2448,16 @@ void QgisApp::addWmsLayer()
QgsDebugMsg( "about to addRasterLayer" );

// TODO: QDialog for now, switch to QWidget in future
QDialog *wmss = dynamic_cast<QDialog*> ( QgsProviderRegistry::instance()->getSelectWidget( QString("wms"), this ) );
if ( !wmss )
QDialog *wmss = dynamic_cast<QDialog*>( QgsProviderRegistry::instance()->selectWidget( QString( "wms" ), this ) );
if ( !wmss )
{
QMessageBox::warning( this, tr( "WMS" ), tr( "Cannot get WMS select dialog from provider." ) );
return;
return;
}
connect ( wmss , SIGNAL ( addRasterLayer( QString const &, QString const &, QString const &,QStringList const &,QStringList const &,QString const &,
QString const &) ),
this , SLOT ( addRasterLayer( QString const &, QString const &, QString const &,QStringList const &,QStringList const &,QString const &,
QString const &) ) );
connect( wmss , SIGNAL( addRasterLayer( QString const &, QString const &, QString const &, QStringList const &, QStringList const &, QString const &,
QString const & ) ),
this , SLOT( addRasterLayer( QString const &, QString const &, QString const &, QStringList const &, QStringList const &, QString const &,
QString const & ) ) );
wmss->exec();
delete wmss;
}
@@ -3103,8 +3103,10 @@ void QgisApp::toggleActiveWindowMaximized()
QWidget *window = QApplication::activeWindow();
if ( window )
{
if ( window->isMaximized() ) window->showNormal();
else window->showMaximized();
if ( window->isMaximized() )
window->showNormal();
else
window->showMaximized();
}
}

@@ -4554,8 +4556,8 @@ void QgisApp::showPluginManager()
// implementation of the python runner
class QgsPythonRunnerImpl : public QgsPythonRunner
{
public:
QgsPythonRunnerImpl(QgsPythonUtils* pythonUtils) : mPythonUtils(pythonUtils) {}
public:
QgsPythonRunnerImpl( QgsPythonUtils* pythonUtils ) : mPythonUtils( pythonUtils ) {}
virtual bool runCommand( QString command, QString messageOnError = QString() )
{
if ( mPythonUtils && mPythonUtils->isEnabled() )
@@ -4565,7 +4567,7 @@ class QgsPythonRunnerImpl : public QgsPythonRunner
return false;
}

protected:
protected:
QgsPythonUtils* mPythonUtils;
};

@@ -4615,7 +4617,7 @@ void QgisApp::loadPythonSupport()
QgsPluginRegistry::instance()->setPythonUtils( mPythonUtils );

// init python runner
QgsPythonRunner::setInstance( new QgsPythonRunnerImpl(mPythonUtils) );
QgsPythonRunner::setInstance( new QgsPythonRunnerImpl( mPythonUtils ) );

std::cout << "Python support ENABLED :-) " << std::endl; // OK
}
@@ -5477,7 +5479,8 @@ void QgisApp::updateMouseCoordinatePrecision()
dp = QgsProject::instance()->readNumEntry( "PositionPrecision", "/DecimalPlaces" );

// Keep dp sensible
if ( dp < 0 ) dp = 0;
if ( dp < 0 )
dp = 0;

mMousePrecisionDecimalPlaces = dp;
}
@@ -71,7 +71,8 @@ void QgsAbout::init()
{
line = stream.readLine(); // line of text excluding '\n'
//ignore the line if it starts with a hash....
if ( line.left( 1 ) == "#" ) continue;
if ( line.left( 1 ) == "#" )
continue;
QStringList myTokens = line.split( "\t", QString::SkipEmptyParts );
lines << myTokens[0];
}
@@ -102,7 +103,8 @@ void QgsAbout::init()
{
line = stream.readLine(); // line of text excluding '\n'
//ignore the line if it starts with a hash....
if ( line.left( 1 ) == "#" ) continue;
if ( line.left( 1 ) == "#" )
continue;
lines += line;
}
file2.close();
@@ -129,7 +131,8 @@ void QgsAbout::init()
"money to fund QGIS development and other project costs see "
"<a href=\"http://qgis.org/en/sponsorship/donors.html\">"
"http://qgis.org/en/sponsorship/donors.html</a></p>" );
/*QString website;
#if 0
QString website;
QTextStream donorsStream( &donorsFile );
// Always use UTF-8
donorsStream.setCodec( "UTF-8" );
@@ -138,7 +141,8 @@ void QgsAbout::init()
{
sline = donorsStream.readLine(); // line of text excluding '\n'
//ignore the line if it starts with a hash....
if ( sline.left( 1 ) == "#" ) continue;
if ( sline.left( 1 ) == "#" )
continue;
QStringList myTokens = sline.split( "|", QString::SkipEmptyParts );
if ( myTokens.size() > 1 )
{
@@ -153,7 +157,8 @@ void QgsAbout::init()
// close the row
donorsHTML += "</tr>";
}
donorsHTML += "</table>";*/
donorsHTML += "</table>";
#endif

QString myStyle = QgsApplication::reportStyleSheet();
txtDonors->clear();
@@ -187,7 +192,8 @@ void QgsAbout::init()
{
sline = translatorStream.readLine(); // line of text excluding '\n'
//ignore the line if it starts with a hash....
if ( sline.left( 1 ) == "#" ) continue;
if ( sline.left( 1 ) == "#" )
continue;
QStringList myTokens = sline.split( "|", QString::SkipEmptyParts );
if ( myTokens.size() > 1 )
{
@@ -164,15 +164,15 @@ void QgsAttributeActionDialog::remove()
attributeActionTable->removeRow( row );

// And select the row below the one that was selected or the last one.
if ( row >= attributeActionTable->rowCount() ) row = attributeActionTable->rowCount() - 1;
if ( row >= attributeActionTable->rowCount() )
row = attributeActionTable->rowCount() - 1;
attributeActionTable->selectRow( row );
}
}

void QgsAttributeActionDialog::insert()
{
// Add the action details as a new row in the table.

int pos = attributeActionTable->rowCount();
insert( pos );
}
@@ -212,7 +212,8 @@ void QgsConfigureShortcutsDialog::changeShortcut()
void QgsConfigureShortcutsDialog::resetShortcut()
{
QAction* action = currentAction();
if ( !action ) return;
if ( !action )
return;

// set default shortcut
QString shortcut = QgsShortcutsManager::instance()->actionDefaultShortcut( action );
@@ -361,7 +362,8 @@ void QgsConfigureShortcutsDialog::setGettingShortcut( bool getting )
void QgsConfigureShortcutsDialog::setCurrentActionShortcut( QKeySequence s )
{
QAction* action = currentAction();
if ( !action ) return;
if ( !action )
return;

// first check whether this action is not taken already
QAction* otherAction = QgsShortcutsManager::instance()->actionForShortcut( s );

0 comments on commit 4549d0e

Please sign in to comment.
You can’t perform that action at this time.