mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
automatic indentation update (r9447-r9780)
git-svn-id: http://svn.osgeo.org/qgis/trunk@9781 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
ff66a181d2
commit
6fbda00825
@ -26,12 +26,12 @@
|
||||
file: installer_data.py
|
||||
---------------------*/
|
||||
|
||||
// Repositories::xmlDownloaded
|
||||
translate("QgsPluginInstaller","Couldn't parse output from the repository")
|
||||
// Repositories::xmlDownloaded
|
||||
translate( "QgsPluginInstaller", "Couldn't parse output from the repository" )
|
||||
|
||||
// Plugins::getAllInstalled
|
||||
translate("QgsPluginInstaller","Couldn't open the system plugin directory")
|
||||
translate("QgsPluginInstaller","Couldn't open the local plugin directory")
|
||||
// Plugins::getAllInstalled
|
||||
translate( "QgsPluginInstaller", "Couldn't open the system plugin directory" )
|
||||
translate( "QgsPluginInstaller", "Couldn't open the local plugin directory" )
|
||||
|
||||
|
||||
|
||||
@ -41,18 +41,18 @@ file: installer_plugin.py
|
||||
------------------------*/
|
||||
|
||||
// InstallerPlugin::initGui
|
||||
translate("QgsPluginInstaller","Fetch Python Plugins...")
|
||||
translate("QgsPluginInstaller","Install more plugins from remote repositories")
|
||||
translate("QgsPluginInstaller","Install more plugins from remote repositories")
|
||||
translate("QgsPluginInstaller","Looking for new plugins...")
|
||||
translate( "QgsPluginInstaller", "Fetch Python Plugins..." )
|
||||
translate( "QgsPluginInstaller", "Install more plugins from remote repositories" )
|
||||
translate( "QgsPluginInstaller", "Install more plugins from remote repositories" )
|
||||
translate( "QgsPluginInstaller", "Looking for new plugins..." )
|
||||
|
||||
// InstallerPlugin::checkingDone
|
||||
translate("QgsPluginInstaller","There is a new plugin available")
|
||||
translate("QgsPluginInstaller","There is a plugin update available")
|
||||
translate( "QgsPluginInstaller", "There is a new plugin available" )
|
||||
translate( "QgsPluginInstaller", "There is a plugin update available" )
|
||||
|
||||
// InstallerPlugin::run
|
||||
translate("QgsPluginInstaller","QGIS Python Plugin Installer")
|
||||
translate("QgsPluginInstaller","Error reading repository:")
|
||||
translate( "QgsPluginInstaller", "QGIS Python Plugin Installer" )
|
||||
translate( "QgsPluginInstaller", "Error reading repository:" )
|
||||
|
||||
|
||||
|
||||
@ -62,160 +62,160 @@ file: installer_gui.py
|
||||
--------------------*/
|
||||
|
||||
// common functions
|
||||
translate("QgsPluginInstaller","Nothing to remove! Plugin directory doesn't exist:")
|
||||
translate("QgsPluginInstaller","Failed to remove the directory:")
|
||||
translate("QgsPluginInstaller","Check permissions or remove it manually")
|
||||
translate( "QgsPluginInstaller", "Nothing to remove! Plugin directory doesn't exist:" )
|
||||
translate( "QgsPluginInstaller", "Failed to remove the directory:" )
|
||||
translate( "QgsPluginInstaller", "Check permissions or remove it manually" )
|
||||
|
||||
QgsPluginInstallerFetchingDialog::foo()
|
||||
{
|
||||
// def displayState
|
||||
tr("Success")
|
||||
tr("Resolving host name...")
|
||||
tr("Connecting...")
|
||||
tr("Host connected. Sending request...")
|
||||
tr("Downloading data...")
|
||||
tr("Idle")
|
||||
tr("Closing connection...")
|
||||
tr("Error")
|
||||
// def displayState
|
||||
tr( "Success" )
|
||||
tr( "Resolving host name..." )
|
||||
tr( "Connecting..." )
|
||||
tr( "Host connected. Sending request..." )
|
||||
tr( "Downloading data..." )
|
||||
tr( "Idle" )
|
||||
tr( "Closing connection..." )
|
||||
tr( "Error" )
|
||||
}
|
||||
|
||||
QgsPluginInstallerInstallingDialog::foo()
|
||||
{
|
||||
// def stateChanged
|
||||
tr("Installing...")
|
||||
tr("Resolving host name...")
|
||||
tr("Connecting...")
|
||||
tr("Host connected. Sending request...")
|
||||
tr("Downloading data...")
|
||||
tr("Idle")
|
||||
tr("Closing connection...")
|
||||
tr("Error")
|
||||
// def stateChanged
|
||||
tr( "Installing..." )
|
||||
tr( "Resolving host name..." )
|
||||
tr( "Connecting..." )
|
||||
tr( "Host connected. Sending request..." )
|
||||
tr( "Downloading data..." )
|
||||
tr( "Idle" )
|
||||
tr( "Closing connection..." )
|
||||
tr( "Error" )
|
||||
|
||||
// def requestFinished
|
||||
tr("Failed to unzip the plugin package. Probably it's broken or missing from the repository. You may also want to make sure that you have write permission to the plugin directory:")
|
||||
// def requestFinished
|
||||
tr( "Failed to unzip the plugin package. Probably it's broken or missing from the repository. You may also want to make sure that you have write permission to the plugin directory:" )
|
||||
|
||||
// def abort
|
||||
tr("Aborted by user")
|
||||
// def abort
|
||||
tr( "Aborted by user" )
|
||||
}
|
||||
|
||||
|
||||
QgsPluginInstallerPluginErrorDialog::foo()
|
||||
{
|
||||
// def __init__
|
||||
tr("no error message received")
|
||||
// def __init__
|
||||
tr( "no error message received" )
|
||||
}
|
||||
|
||||
QgsPluginInstallerDialog::foo()
|
||||
{
|
||||
// def __init__
|
||||
// def __init__
|
||||
|
||||
// def getAllAvailablePlugins
|
||||
tr("QGIS Python Plugin Installer")
|
||||
tr("Error reading repository:")
|
||||
// def getAllAvailablePlugins
|
||||
tr( "QGIS Python Plugin Installer" )
|
||||
tr( "Error reading repository:" )
|
||||
|
||||
// def populateMostWidgets
|
||||
tr("all repositories")
|
||||
tr("connected")
|
||||
tr("This repository is connected")
|
||||
tr("unavailable")
|
||||
tr("This repository is enabled, but unavailable")
|
||||
tr("disabled")
|
||||
tr("This repository is disabled")
|
||||
tr("This repository is blocked due to incompatibility with your Quantum GIS version")
|
||||
tr("orphans")
|
||||
tr("any status")
|
||||
tr("not installed", "plural")
|
||||
tr("installed", "plural")
|
||||
tr("upgradeable and news")
|
||||
// def populateMostWidgets
|
||||
tr( "all repositories" )
|
||||
tr( "connected" )
|
||||
tr( "This repository is connected" )
|
||||
tr( "unavailable" )
|
||||
tr( "This repository is enabled, but unavailable" )
|
||||
tr( "disabled" )
|
||||
tr( "This repository is disabled" )
|
||||
tr( "This repository is blocked due to incompatibility with your Quantum GIS version" )
|
||||
tr( "orphans" )
|
||||
tr( "any status" )
|
||||
tr( "not installed", "plural" )
|
||||
tr( "installed", "plural" )
|
||||
tr( "upgradeable and news" )
|
||||
|
||||
// def filterChanged
|
||||
// def filterChanged
|
||||
|
||||
// def filterCheck
|
||||
tr("orphans")
|
||||
tr("orphans")
|
||||
// def filterCheck
|
||||
tr( "orphans" )
|
||||
tr( "orphans" )
|
||||
|
||||
// def populatePluginTree
|
||||
tr("This plugin is not installed")
|
||||
tr("This plugin is installed")
|
||||
tr("This plugin is installed, but there is an updated version available")
|
||||
tr("This plugin is installed, but I can't find it in any enabled repository")
|
||||
tr("This plugin is not installed and is seen for the first time")
|
||||
tr("This plugin is installed and is newer than its version available in a repository")
|
||||
tr("This plugin is incompatible with your Quantum GIS version and probably won't work.")
|
||||
tr("The required Python module is not installed.\nFor more information, please visit its homepage and Quantum GIS wiki.")
|
||||
tr("This plugin seems to be broken.\nIt has been installed but can't be loaded.\nHere is the error message:")
|
||||
tr("not installed", "singular")
|
||||
tr("installed", "singular")
|
||||
tr("upgradeable", "singular")
|
||||
tr("installed", "singular")
|
||||
tr("new!", "singular")
|
||||
tr("installed", "singular")
|
||||
tr("invalid", "singular")
|
||||
tr("Note that it's an uninstallable core plugin")
|
||||
tr("installed version")
|
||||
tr("available version")
|
||||
tr("available version")
|
||||
tr("installed version")
|
||||
tr("That's the newest available version")
|
||||
tr("installed version")
|
||||
tr("There is no version available for download")
|
||||
tr("This plugin is broken")
|
||||
tr("This plugin requires a newer version of Quantum GIS")
|
||||
tr("This plugin requires a missing module")
|
||||
tr("only locally available")
|
||||
// def populatePluginTree
|
||||
tr( "This plugin is not installed" )
|
||||
tr( "This plugin is installed" )
|
||||
tr( "This plugin is installed, but there is an updated version available" )
|
||||
tr( "This plugin is installed, but I can't find it in any enabled repository" )
|
||||
tr( "This plugin is not installed and is seen for the first time" )
|
||||
tr( "This plugin is installed and is newer than its version available in a repository" )
|
||||
tr( "This plugin is incompatible with your Quantum GIS version and probably won't work." )
|
||||
tr( "The required Python module is not installed.\nFor more information, please visit its homepage and Quantum GIS wiki." )
|
||||
tr( "This plugin seems to be broken.\nIt has been installed but can't be loaded.\nHere is the error message:" )
|
||||
tr( "not installed", "singular" )
|
||||
tr( "installed", "singular" )
|
||||
tr( "upgradeable", "singular" )
|
||||
tr( "installed", "singular" )
|
||||
tr( "new!", "singular" )
|
||||
tr( "installed", "singular" )
|
||||
tr( "invalid", "singular" )
|
||||
tr( "Note that it's an uninstallable core plugin" )
|
||||
tr( "installed version" )
|
||||
tr( "available version" )
|
||||
tr( "available version" )
|
||||
tr( "installed version" )
|
||||
tr( "That's the newest available version" )
|
||||
tr( "installed version" )
|
||||
tr( "There is no version available for download" )
|
||||
tr( "This plugin is broken" )
|
||||
tr( "This plugin requires a newer version of Quantum GIS" )
|
||||
tr( "This plugin requires a missing module" )
|
||||
tr( "only locally available" )
|
||||
|
||||
// def treeClicked
|
||||
tr("Install plugin")
|
||||
tr("Reinstall plugin")
|
||||
tr("Upgrade plugin")
|
||||
tr("Install/upgrade plugin")
|
||||
tr("Install plugin")
|
||||
tr("Downgrade plugin")
|
||||
tr("Reinstall plugin")
|
||||
tr("Install/upgrade plugin")
|
||||
// def treeClicked
|
||||
tr( "Install plugin" )
|
||||
tr( "Reinstall plugin" )
|
||||
tr( "Upgrade plugin" )
|
||||
tr( "Install/upgrade plugin" )
|
||||
tr( "Install plugin" )
|
||||
tr( "Downgrade plugin" )
|
||||
tr( "Reinstall plugin" )
|
||||
tr( "Install/upgrade plugin" )
|
||||
|
||||
// def installPlugin
|
||||
tr("QGIS Python Plugin Installer")
|
||||
tr("Are you sure you want to downgrade the plugin to the latest available version? The installed one is newer!")
|
||||
tr("Plugin installation failed")
|
||||
tr("Plugin has disappeared")
|
||||
tr("The plugin seems to have been installed but I don't know where. Probably the plugin package contained a wrong named directory.\nPlease search the list of installed plugins. I'm nearly sure you'll find the plugin there, but I just can't determine which of them it is. It also means that I won't be able to determine if this plugin is installed and inform you about available updates. However the plugin may work. Please contact the plugin author and submit this issue.")
|
||||
tr("Plugin installed successfully")
|
||||
tr("Python plugin installed.\nNow you need to enable it in Plugin Manager.")
|
||||
tr("Plugin reinstalled successfully")
|
||||
tr("Python plugin reinstalled.\nYou need to restart Quantum GIS in order to reload it.")
|
||||
tr("The plugin is designed for a newer version of Quantum GIS. The minimum required version is:")
|
||||
tr("The plugin depends on some components missing on your system. You need to install the following Python module in order to enable it:")
|
||||
tr("The plugin is broken. Python said:")
|
||||
tr("Plugin uninstall failed")
|
||||
// def installPlugin
|
||||
tr( "QGIS Python Plugin Installer" )
|
||||
tr( "Are you sure you want to downgrade the plugin to the latest available version? The installed one is newer!" )
|
||||
tr( "Plugin installation failed" )
|
||||
tr( "Plugin has disappeared" )
|
||||
tr( "The plugin seems to have been installed but I don't know where. Probably the plugin package contained a wrong named directory.\nPlease search the list of installed plugins. I'm nearly sure you'll find the plugin there, but I just can't determine which of them it is. It also means that I won't be able to determine if this plugin is installed and inform you about available updates. However the plugin may work. Please contact the plugin author and submit this issue." )
|
||||
tr( "Plugin installed successfully" )
|
||||
tr( "Python plugin installed.\nNow you need to enable it in Plugin Manager." )
|
||||
tr( "Plugin reinstalled successfully" )
|
||||
tr( "Python plugin reinstalled.\nYou need to restart Quantum GIS in order to reload it." )
|
||||
tr( "The plugin is designed for a newer version of Quantum GIS. The minimum required version is:" )
|
||||
tr( "The plugin depends on some components missing on your system. You need to install the following Python module in order to enable it:" )
|
||||
tr( "The plugin is broken. Python said:" )
|
||||
tr( "Plugin uninstall failed" )
|
||||
|
||||
// def uninstallPlugin
|
||||
tr("Are you sure you want to uninstall the following plugin?")
|
||||
tr("Warning: this plugin isn't available in any accessible repository!")
|
||||
tr("QGIS Python Plugin Installer")
|
||||
tr("Plugin uninstall failed")
|
||||
tr("QGIS Python Plugin Installer")
|
||||
tr("Plugin uninstalled successfully")
|
||||
tr("Python plugin uninstalled. Note that tou may need to restart Quantum GIS in order to remove it completely.")
|
||||
// def ChangeCheckingPolicy
|
||||
// def uninstallPlugin
|
||||
tr( "Are you sure you want to uninstall the following plugin?" )
|
||||
tr( "Warning: this plugin isn't available in any accessible repository!" )
|
||||
tr( "QGIS Python Plugin Installer" )
|
||||
tr( "Plugin uninstall failed" )
|
||||
tr( "QGIS Python Plugin Installer" )
|
||||
tr( "Plugin uninstalled successfully" )
|
||||
tr( "Python plugin uninstalled. Note that tou may need to restart Quantum GIS in order to remove it completely." )
|
||||
// def ChangeCheckingPolicy
|
||||
|
||||
// def addKnownRepositories
|
||||
tr("You are going to add some plugin repositories neither authorized nor supported by the Quantum GIS team, however provided by folks associated with us. Plugin authors generally make efforts to make their works useful and safe, but we can't assume any responsibility for them. FEEL WARNED!")
|
||||
tr("QGIS Python Plugin Installer")
|
||||
// def addKnownRepositories
|
||||
tr( "You are going to add some plugin repositories neither authorized nor supported by the Quantum GIS team, however provided by folks associated with us. Plugin authors generally make efforts to make their works useful and safe, but we can't assume any responsibility for them. FEEL WARNED!" )
|
||||
tr( "QGIS Python Plugin Installer" )
|
||||
|
||||
// def addRepository
|
||||
tr("QGIS Python Plugin Installer")
|
||||
tr("Unable to add another repository with the same URL!")
|
||||
// def addRepository
|
||||
tr( "QGIS Python Plugin Installer" )
|
||||
tr( "Unable to add another repository with the same URL!" )
|
||||
|
||||
// def editRepository
|
||||
tr("This repository is blocked due to incompatibility with your Quantum GIS version")
|
||||
tr("QGIS Python Plugin Installer")
|
||||
tr("Unable to add another repository with the same URL!")
|
||||
// def editRepository
|
||||
tr( "This repository is blocked due to incompatibility with your Quantum GIS version" )
|
||||
tr( "QGIS Python Plugin Installer" )
|
||||
tr( "Unable to add another repository with the same URL!" )
|
||||
|
||||
// def deleteRepository
|
||||
tr("Are you sure you want to remove the following repository?")
|
||||
tr("QGIS Python Plugin Installer")
|
||||
// def deleteRepository
|
||||
tr( "Are you sure you want to remove the following repository?" )
|
||||
tr( "QGIS Python Plugin Installer" )
|
||||
|
||||
// def reject
|
||||
// def reject
|
||||
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ QgsComposer::QgsComposer( QgisApp *qgis ): QMainWindow()
|
||||
QString myIconPath = QgsApplication::activeThemePath();
|
||||
|
||||
QActionGroup* toggleActionGroup = new QActionGroup( this );
|
||||
toggleActionGroup->addAction( mActionMoveItemContent);
|
||||
toggleActionGroup->addAction( mActionMoveItemContent );
|
||||
toggleActionGroup->addAction( mActionAddNewMap );
|
||||
toggleActionGroup->addAction( mActionAddNewLabel );
|
||||
toggleActionGroup->addAction( mActionAddNewLegend );
|
||||
@ -222,13 +222,13 @@ void QgsComposer::setupTheme()
|
||||
mActionAddNewLegend->setIcon( QgisApp::getThemeIcon( "/mActionAddLegend.png" ) );
|
||||
mActionAddNewScalebar->setIcon( QgisApp::getThemeIcon( "/mActionScaleBar.png" ) );
|
||||
mActionSelectMoveItem->setIcon( QgisApp::getThemeIcon( "/mActionSelectPan.png" ) );
|
||||
mActionMoveItemContent->setIcon( QgisApp::getThemeIcon("/mActionMoveItemContent.png"));
|
||||
mActionGroupItems->setIcon( QgisApp::getThemeIcon("/mActionGroupItems.png"));
|
||||
mActionUngroupItems->setIcon( QgisApp::getThemeIcon("/mActionUngroupItems.png"));
|
||||
mActionRaiseItems->setIcon( QgisApp::getThemeIcon("/mActionRaiseItems.png"));
|
||||
mActionLowerItems->setIcon( QgisApp::getThemeIcon("/mActionLowerItems.png"));
|
||||
mActionMoveItemsToTop->setIcon( QgisApp::getThemeIcon("/mActionMoveItemsToTop.png"));
|
||||
mActionMoveItemsToBottom->setIcon( QgisApp::getThemeIcon("/mActionMoveItemsToBottom.png"));
|
||||
mActionMoveItemContent->setIcon( QgisApp::getThemeIcon( "/mActionMoveItemContent.png" ) );
|
||||
mActionGroupItems->setIcon( QgisApp::getThemeIcon( "/mActionGroupItems.png" ) );
|
||||
mActionUngroupItems->setIcon( QgisApp::getThemeIcon( "/mActionUngroupItems.png" ) );
|
||||
mActionRaiseItems->setIcon( QgisApp::getThemeIcon( "/mActionRaiseItems.png" ) );
|
||||
mActionLowerItems->setIcon( QgisApp::getThemeIcon( "/mActionLowerItems.png" ) );
|
||||
mActionMoveItemsToTop->setIcon( QgisApp::getThemeIcon( "/mActionMoveItemsToTop.png" ) );
|
||||
mActionMoveItemsToBottom->setIcon( QgisApp::getThemeIcon( "/mActionMoveItemsToBottom.png" ) );
|
||||
}
|
||||
|
||||
void QgsComposer::connectSlots()
|
||||
@ -712,7 +712,7 @@ void QgsComposer::on_mActionAddImage_activated( void )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsComposer::on_mActionMoveItemContent_activated(void)
|
||||
void QgsComposer::on_mActionMoveItemContent_activated( void )
|
||||
{
|
||||
if ( mView )
|
||||
{
|
||||
@ -744,7 +744,7 @@ void QgsComposer::on_mActionRaiseItems_activated( void )
|
||||
}
|
||||
}
|
||||
|
||||
void QgsComposer::on_mActionLowerItems_activated(void)
|
||||
void QgsComposer::on_mActionLowerItems_activated( void )
|
||||
{
|
||||
if ( mComposition )
|
||||
{
|
||||
@ -752,7 +752,7 @@ void QgsComposer::on_mActionLowerItems_activated(void)
|
||||
}
|
||||
}
|
||||
|
||||
void QgsComposer::on_mActionMoveItemsToTop_activated(void)
|
||||
void QgsComposer::on_mActionMoveItemsToTop_activated( void )
|
||||
{
|
||||
if ( mComposition )
|
||||
{
|
||||
@ -760,7 +760,7 @@ void QgsComposer::on_mActionMoveItemsToTop_activated(void)
|
||||
}
|
||||
}
|
||||
|
||||
void QgsComposer::on_mActionMoveItemsToBottom_activated(void)
|
||||
void QgsComposer::on_mActionMoveItemsToBottom_activated( void )
|
||||
{
|
||||
if ( mComposition )
|
||||
{
|
||||
|
@ -133,7 +133,7 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
|
||||
void on_mActionAddImage_activated( void );
|
||||
|
||||
//! Set tool to move item content
|
||||
void on_mActionMoveItemContent_activated(void);
|
||||
void on_mActionMoveItemContent_activated( void );
|
||||
|
||||
//! Group selected items
|
||||
void on_mActionGroupItems_activated( void );
|
||||
@ -142,16 +142,16 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
|
||||
void on_mActionUngroupItems_activated( void );
|
||||
|
||||
//! Move selected items one position up
|
||||
void on_mActionRaiseItems_activated(void);
|
||||
void on_mActionRaiseItems_activated( void );
|
||||
|
||||
//!Move selected items one position down
|
||||
void on_mActionLowerItems_activated(void);
|
||||
void on_mActionLowerItems_activated( void );
|
||||
|
||||
//!Move selected items to top
|
||||
void on_mActionMoveItemsToTop_activated(void);
|
||||
void on_mActionMoveItemsToTop_activated( void );
|
||||
|
||||
//!Move selected items to bottom
|
||||
void on_mActionMoveItemsToBottom_activated(void);
|
||||
void on_mActionMoveItemsToBottom_activated( void );
|
||||
|
||||
//! Save window state
|
||||
void saveWindowState();
|
||||
|
@ -283,35 +283,35 @@ void QgsComposerScaleBarWidget::on_mStyleComboBox_currentIndexChanged( const QSt
|
||||
}
|
||||
|
||||
QString untranslatedStyleName;
|
||||
if(text == tr("Single Box"))
|
||||
if ( text == tr( "Single Box" ) )
|
||||
{
|
||||
untranslatedStyleName = "Single Box";
|
||||
}
|
||||
else if(text == tr("Double Box"))
|
||||
{
|
||||
untranslatedStyleName = "Double Box";
|
||||
}
|
||||
else if(text == tr( "Line Ticks Middle" ))
|
||||
else if ( text == tr( "Double Box" ) )
|
||||
{
|
||||
untranslatedStyleName = "Line Ticks Middle";
|
||||
untranslatedStyleName = "Double Box";
|
||||
}
|
||||
else if(text == tr("Line Ticks Middle"))
|
||||
else if ( text == tr( "Line Ticks Middle" ) )
|
||||
{
|
||||
untranslatedStyleName = "Line Ticks Middle";
|
||||
untranslatedStyleName = "Line Ticks Middle";
|
||||
}
|
||||
else if(text == tr( "Line Ticks Down" ))
|
||||
else if ( text == tr( "Line Ticks Middle" ) )
|
||||
{
|
||||
untranslatedStyleName = "Line Ticks Down";
|
||||
untranslatedStyleName = "Line Ticks Middle";
|
||||
}
|
||||
else if(text == tr( "Line Ticks Up"))
|
||||
else if ( text == tr( "Line Ticks Down" ) )
|
||||
{
|
||||
untranslatedStyleName = "Line Ticks Up";
|
||||
untranslatedStyleName = "Line Ticks Down";
|
||||
}
|
||||
else if(text == tr( "Numeric"))
|
||||
else if ( text == tr( "Line Ticks Up" ) )
|
||||
{
|
||||
untranslatedStyleName = "Numeric";
|
||||
untranslatedStyleName = "Line Ticks Up";
|
||||
}
|
||||
mComposerScaleBar->setStyle(untranslatedStyleName);
|
||||
else if ( text == tr( "Numeric" ) )
|
||||
{
|
||||
untranslatedStyleName = "Numeric";
|
||||
}
|
||||
mComposerScaleBar->setStyle( untranslatedStyleName );
|
||||
mComposerScaleBar->update();
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,7 @@ void QgsLegend::removeLayer( QString layer_key )
|
||||
|
||||
QTreeWidgetItem* theItem = firstItem();
|
||||
QgsDebugMsg( "called." );
|
||||
|
||||
|
||||
QgsLegendLayer* lastLL = NULL;
|
||||
|
||||
while ( theItem )
|
||||
@ -177,15 +177,15 @@ void QgsLegend::removeLayer( QString layer_key )
|
||||
mStateOfCheckBoxes.erase( llf );
|
||||
removeItem( llf );
|
||||
delete llf;
|
||||
|
||||
|
||||
// delete also parent legend layer if now it's empty
|
||||
if (lastLL->mapLayers().size() == 0)
|
||||
if ( lastLL->mapLayers().size() == 0 )
|
||||
{
|
||||
mStateOfCheckBoxes.erase( lastLL );
|
||||
removeItem( lastLL );
|
||||
delete lastLL;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -637,7 +637,7 @@ void QgsLegend::legendLayerRemove()
|
||||
}
|
||||
}
|
||||
|
||||
if (layerCount == 0)
|
||||
if ( layerCount == 0 )
|
||||
{
|
||||
// delete the item only when it didn't have any child legend layer files
|
||||
// (otherwise it is deleted in QgsLegend::removeLayer when deleting last legend layer file)
|
||||
@ -645,7 +645,7 @@ void QgsLegend::legendLayerRemove()
|
||||
removeItem( ll );
|
||||
delete ll;
|
||||
}
|
||||
|
||||
|
||||
adjustIconSize();
|
||||
return;
|
||||
}
|
||||
|
@ -304,7 +304,7 @@ QgisApp *QgisApp::smInstance = 0;
|
||||
QgisApp::QgisApp( QSplashScreen *splash, QWidget * parent, Qt::WFlags fl )
|
||||
: QMainWindow( parent, fl ),
|
||||
mSplash( splash ),
|
||||
mComposer(0),
|
||||
mComposer( 0 ),
|
||||
mPythonConsole( NULL ),
|
||||
mPythonUtils( NULL )
|
||||
{
|
||||
@ -1482,7 +1482,7 @@ void QgisApp::setTheme( QString theThemeName )
|
||||
mActionAddWmsLayer->setIcon( getThemeIcon( "/mActionAddWmsLayer.png" ) );
|
||||
mActionAddToOverview->setIcon( getThemeIcon( "/mActionInOverview.png" ) );
|
||||
|
||||
if(mComposer)
|
||||
if ( mComposer )
|
||||
{
|
||||
mComposer->setupTheme();
|
||||
}
|
||||
@ -4872,7 +4872,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
|
||||
{
|
||||
mActionToggleEditing->setEnabled( false );
|
||||
}
|
||||
|
||||
|
||||
if ( dprovider->capabilities() & QgsVectorDataProvider::AddFeatures )
|
||||
{
|
||||
mActionPasteFeatures->setEnabled( vlayer->isEditable() && !clipboard()->empty() );
|
||||
@ -4893,7 +4893,7 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
|
||||
mActionDeleteSelected->setEnabled( false );
|
||||
mActionCutFeatures->setEnabled( false );
|
||||
}
|
||||
|
||||
|
||||
// moving enabled if geometry changes are supported
|
||||
if ( vlayer->isEditable() && dprovider->capabilities() & QgsVectorDataProvider::ChangeGeometries )
|
||||
{
|
||||
|
@ -491,7 +491,7 @@ void QgsAttributeTable::fillTable( QgsVectorLayer *layer )
|
||||
else
|
||||
{
|
||||
QgsRectangle rect;
|
||||
if( behaviour == 2 )
|
||||
if ( behaviour == 2 )
|
||||
{
|
||||
// current canvas only
|
||||
rect = QgisApp::instance()->mapCanvas()->extent();
|
||||
|
@ -203,8 +203,8 @@ void QgsLabelDialog::init( )
|
||||
spinYOffset->setValue( 0 );
|
||||
}
|
||||
spinAngle->setRange( -1, 360 );
|
||||
spinAngle->setSpecialValueText( tr("Auto") );
|
||||
if( myLabelAttributes->angleIsAuto() )
|
||||
spinAngle->setSpecialValueText( tr( "Auto" ) );
|
||||
if ( myLabelAttributes->angleIsAuto() )
|
||||
{
|
||||
spinAngle->setValue( -1 );
|
||||
}
|
||||
@ -256,7 +256,7 @@ void QgsLabelDialog::init( )
|
||||
spinBufferSize->setValue( static_cast<int>( myLabelAttributes->bufferSize() ) );
|
||||
//TODO - transparency attributes for buffers
|
||||
|
||||
listWidget->setItemSelected( listWidget->item(0), true);
|
||||
listWidget->setItemSelected( listWidget->item( 0 ), true );
|
||||
}
|
||||
|
||||
|
||||
@ -352,7 +352,7 @@ void QgsLabelDialog::apply()
|
||||
myLabelAttributes->setOffset( spinXOffset->value(), spinYOffset->value(), myTypeInt );
|
||||
myLabelAttributes->setAutoAngle( spinAngle->value() == -1 );
|
||||
myLabelAttributes->setAngle( spinAngle->value() );
|
||||
|
||||
|
||||
//the values here may seem a bit counterintuitive - basically everything
|
||||
//is the reverse of the way you think it should be...
|
||||
//TODO investigate in QgsLabel why this needs to be the case
|
||||
|
@ -56,22 +56,22 @@ void QgsMapToolAddIsland::canvasReleaseEvent( QMouseEvent * e )
|
||||
//inform user at the begin of the digitising action that the island tool only works if exactly one feature is selected
|
||||
int nSelectedFeatures = vlayer->selectedFeatureCount();
|
||||
QString selectionErrorMsg;
|
||||
if(nSelectedFeatures < 1)
|
||||
if ( nSelectedFeatures < 1 )
|
||||
{
|
||||
selectionErrorMsg = "No feature selected. Please select a feature with the selection tool or in the attribute table";
|
||||
selectionErrorMsg = "No feature selected. Please select a feature with the selection tool or in the attribute table";
|
||||
}
|
||||
else if(nSelectedFeatures > 1)
|
||||
else if ( nSelectedFeatures > 1 )
|
||||
{
|
||||
selectionErrorMsg = "Several features are selected. Please select only one feature to which an island should be added.";
|
||||
selectionErrorMsg = "Several features are selected. Please select only one feature to which an island should be added.";
|
||||
}
|
||||
|
||||
if(!selectionErrorMsg.isEmpty())
|
||||
if ( !selectionErrorMsg.isEmpty() )
|
||||
{
|
||||
QMessageBox::critical( 0, QObject::tr( "Error, could not add island" ), selectionErrorMsg );
|
||||
mCaptureList.clear();
|
||||
delete mRubberBand;
|
||||
mRubberBand = 0;
|
||||
return;
|
||||
QMessageBox::critical( 0, QObject::tr( "Error, could not add island" ), selectionErrorMsg );
|
||||
mCaptureList.clear();
|
||||
delete mRubberBand;
|
||||
mRubberBand = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
//add point to list and to rubber band
|
||||
|
@ -147,11 +147,11 @@ void QgsPluginManager::getPythonPluginDescriptions()
|
||||
QString version = mPythonUtils->getPluginMetadata( packageName, "version" );
|
||||
|
||||
if ( pluginName == "???" || description == "???" || version == "???" ) continue;
|
||||
|
||||
|
||||
bool isCompatible = QgsPluginRegistry::instance()->isPythonPluginCompatible( packageName );
|
||||
QString compatibleString; // empty by default
|
||||
if (!isCompatible)
|
||||
compatibleString = " " + tr("[ incompatible ]");
|
||||
if ( !isCompatible )
|
||||
compatibleString = " " + tr( "[ incompatible ]" );
|
||||
|
||||
// filtering will be done on the display role so give it name and desription
|
||||
// user wont see this text since we are using a custome delegate
|
||||
|
@ -152,44 +152,44 @@ void QgsPluginRegistry::unloadAll()
|
||||
}
|
||||
|
||||
|
||||
bool QgsPluginRegistry::checkQgisVersion(QString minVersion)
|
||||
bool QgsPluginRegistry::checkQgisVersion( QString minVersion )
|
||||
{
|
||||
QStringList minVersionParts = minVersion.split('.');
|
||||
QStringList minVersionParts = minVersion.split( '.' );
|
||||
// qgis version must be in form x.y.z or just x.y
|
||||
if (minVersionParts.count() != 2 && minVersionParts.count() != 3)
|
||||
if ( minVersionParts.count() != 2 && minVersionParts.count() != 3 )
|
||||
return false;
|
||||
|
||||
int minVerMajor, minVerMinor, minVerBugfix=0;
|
||||
|
||||
int minVerMajor, minVerMinor, minVerBugfix = 0;
|
||||
bool ok;
|
||||
minVerMajor = minVersionParts.at(0).toInt(&ok);
|
||||
if (!ok) return false;
|
||||
minVerMinor = minVersionParts.at(1).toInt(&ok);
|
||||
if (!ok) return false;
|
||||
if (minVersionParts.count() == 3)
|
||||
minVerMajor = minVersionParts.at( 0 ).toInt( &ok );
|
||||
if ( !ok ) return false;
|
||||
minVerMinor = minVersionParts.at( 1 ).toInt( &ok );
|
||||
if ( !ok ) return false;
|
||||
if ( minVersionParts.count() == 3 )
|
||||
{
|
||||
minVerBugfix = minVersionParts.at(2).toInt(&ok);
|
||||
if (!ok) return false;
|
||||
minVerBugfix = minVersionParts.at( 2 ).toInt( &ok );
|
||||
if ( !ok ) return false;
|
||||
}
|
||||
|
||||
|
||||
// our qgis version - cut release name after version number
|
||||
QString qgisVersion = QString(QGis::QGIS_VERSION).section( '-', 0, 0 );
|
||||
QString qgisVersion = QString( QGis::QGIS_VERSION ).section( '-', 0, 0 );
|
||||
QStringList qgisVersionParts = qgisVersion.split( "." );
|
||||
|
||||
int qgisMajor = qgisVersionParts.at( 0 ).toInt();
|
||||
int qgisMinor = qgisVersionParts.at( 1 ).toInt();
|
||||
int qgisBugfix= qgisVersionParts.at( 2 ).toInt();
|
||||
int qgisBugfix = qgisVersionParts.at( 2 ).toInt();
|
||||
|
||||
// first check major version
|
||||
if (minVerMajor > qgisMajor) return false;
|
||||
if (minVerMajor < qgisMajor) return true;
|
||||
|
||||
if ( minVerMajor > qgisMajor ) return false;
|
||||
if ( minVerMajor < qgisMajor ) return true;
|
||||
|
||||
// if same, check minor version
|
||||
if (minVerMinor > qgisMinor) return false;
|
||||
if (minVerMinor < qgisMinor) return true;
|
||||
|
||||
if ( minVerMinor > qgisMinor ) return false;
|
||||
if ( minVerMinor < qgisMinor ) return true;
|
||||
|
||||
// if still same, check bugfix version
|
||||
if (minVerBugfix > qgisBugfix) return false;
|
||||
|
||||
if ( minVerBugfix > qgisBugfix ) return false;
|
||||
|
||||
// looks like min version is the same as our version - that's fine
|
||||
return true;
|
||||
}
|
||||
@ -202,7 +202,7 @@ void QgsPluginRegistry::loadPythonPlugin( QString packageName )
|
||||
QgsDebugMsg( "Python is not enabled in QGIS." );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
QSettings settings;
|
||||
|
||||
// is loaded already?
|
||||
@ -214,12 +214,12 @@ void QgsPluginRegistry::loadPythonPlugin( QString packageName )
|
||||
settings.setValue( "/PythonPlugins/" + packageName, false );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
mPythonUtils->loadPlugin( packageName );
|
||||
mPythonUtils->startPlugin( packageName );
|
||||
|
||||
// TODO: test success
|
||||
|
||||
|
||||
QString pluginName = mPythonUtils->getPluginMetadata( packageName, "name" );
|
||||
|
||||
// add to plugin registry
|
||||
@ -228,7 +228,7 @@ void QgsPluginRegistry::loadPythonPlugin( QString packageName )
|
||||
// add to settings
|
||||
settings.setValue( "/PythonPlugins/" + packageName, true );
|
||||
std::cout << "Loaded : " << pluginName.toLocal8Bit().constData() << " (package: "
|
||||
<< packageName.toLocal8Bit().constData() << ")" << std::endl; // OK
|
||||
<< packageName.toLocal8Bit().constData() << ")" << std::endl; // OK
|
||||
|
||||
}
|
||||
}
|
||||
@ -247,7 +247,7 @@ void QgsPluginRegistry::loadCppPlugin( QString theFullPathName )
|
||||
// QMessageBox::warning(this, "Already Loaded", description + " is already loaded");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
QLibrary myLib( theFullPathName );
|
||||
|
||||
QString myError; //we will only show detailed diagnostics if something went wrong
|
||||
@ -259,7 +259,7 @@ void QgsPluginRegistry::loadCppPlugin( QString theFullPathName )
|
||||
QgsDebugMsg( "Failed to load " + theFullPathName );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
myError += "Attempting to resolve the classFactory function " + QString( __LINE__ ) + " in " + QString( __FUNCTION__ ) + "\n";
|
||||
|
||||
type_t *pType = ( type_t * ) cast_to_fptr( myLib.resolve( "type" ) );
|
||||
@ -288,8 +288,8 @@ void QgsPluginRegistry::loadCppPlugin( QString theFullPathName )
|
||||
// something went wrong
|
||||
QMessageBox::warning( mQgisInterface->mainWindow(), QObject::tr( "Error Loading Plugin" ),
|
||||
QObject::tr( "There was an error loading a plugin."
|
||||
"The following diagnostic information may help the QGIS developers resolve the issue:\n%1." ).arg
|
||||
( myError ) );
|
||||
"The following diagnostic information may help the QGIS developers resolve the issue:\n%1." ).arg
|
||||
( myError ) );
|
||||
//disable it to the qsettings file [ts]
|
||||
settings.setValue( "/Plugins/" + baseName, false );
|
||||
}
|
||||
@ -326,7 +326,7 @@ void QgsPluginRegistry::restoreSessionPlugins( QString thePluginDirString )
|
||||
for ( uint i = 0; i < myPluginDir.count(); i++ )
|
||||
{
|
||||
QString myFullPath = thePluginDirString + "/" + myPluginDir[i];
|
||||
if (checkCppPlugin( myFullPath ) )
|
||||
if ( checkCppPlugin( myFullPath ) )
|
||||
{
|
||||
// check if the plugin was active on last session
|
||||
|
||||
@ -337,18 +337,18 @@ void QgsPluginRegistry::restoreSessionPlugins( QString thePluginDirString )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( mPythonUtils && mPythonUtils->isEnabled() )
|
||||
{
|
||||
// check for python plugins system-wide
|
||||
QStringList pluginList = mPythonUtils->pluginList();
|
||||
QgsDebugMsg("Loading python plugins");
|
||||
QgsDebugMsg( "Loading python plugins" );
|
||||
|
||||
for ( int i = 0; i < pluginList.size(); i++ )
|
||||
{
|
||||
QString packageName = pluginList[i];
|
||||
|
||||
if (checkPythonPlugin( packageName ) )
|
||||
|
||||
if ( checkPythonPlugin( packageName ) )
|
||||
{
|
||||
// check if the plugin was active on last session
|
||||
|
||||
@ -360,9 +360,9 @@ void QgsPluginRegistry::restoreSessionPlugins( QString thePluginDirString )
|
||||
}
|
||||
}
|
||||
|
||||
QgsDebugMsg("Plugin loading completed");
|
||||
QgsDebugMsg( "Plugin loading completed" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool QgsPluginRegistry::checkCppPlugin( QString pluginFullPath )
|
||||
{
|
||||
@ -378,14 +378,14 @@ bool QgsPluginRegistry::checkCppPlugin( QString pluginFullPath )
|
||||
name_t * myName = ( name_t * ) cast_to_fptr( myLib.resolve( "name" ) );
|
||||
description_t * myDescription = ( description_t * ) cast_to_fptr( myLib.resolve( "description" ) );
|
||||
version_t * myVersion = ( version_t * ) cast_to_fptr( myLib.resolve( "version" ) );
|
||||
|
||||
|
||||
if ( myName && myDescription && myVersion )
|
||||
return true;
|
||||
|
||||
QgsDebugMsg("Failed to get name, description, or type for " + myLib.fileName());
|
||||
|
||||
QgsDebugMsg( "Failed to get name, description, or type for " + myLib.fileName() );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool QgsPluginRegistry::checkPythonPlugin( QString packageName )
|
||||
{
|
||||
@ -394,7 +394,7 @@ bool QgsPluginRegistry::checkPythonPlugin( QString packageName )
|
||||
return false;
|
||||
|
||||
QString pluginName, description, version;
|
||||
|
||||
|
||||
// get information from the plugin
|
||||
// if there are some problems, don't continue with metadata retreival
|
||||
pluginName = mPythonUtils->getPluginMetadata( packageName, "name" );
|
||||
@ -411,14 +411,14 @@ bool QgsPluginRegistry::checkPythonPlugin( QString packageName )
|
||||
QObject::tr( "Error when reading metadata of plugin " ) + packageName );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool QgsPluginRegistry::isPythonPluginCompatible( QString packageName )
|
||||
{
|
||||
QString minVersion = mPythonUtils->getPluginMetadata( packageName, "qgisMinimumVersion" );
|
||||
if (minVersion == "__error__" || !checkQgisVersion(minVersion))
|
||||
if ( minVersion == "__error__" || !checkQgisVersion( minVersion ) )
|
||||
{
|
||||
//QMessageBox::information(mQgisInterface->mainWindow(),
|
||||
// QObject::tr("Incompatible plugin"),
|
||||
|
@ -42,7 +42,7 @@ class QgsPluginRegistry
|
||||
public:
|
||||
//! Returns the instance pointer, creating the object on the first call
|
||||
static QgsPluginRegistry* instance();
|
||||
|
||||
|
||||
//! set pointer to qgis interface passed to plugins (used by QgisApp)
|
||||
void setQgisInterface( QgisInterface* iface );
|
||||
|
||||
@ -77,13 +77,13 @@ class QgsPluginRegistry
|
||||
void loadCppPlugin( QString mFullPath );
|
||||
//! Python plugin loader
|
||||
void loadPythonPlugin( QString packageName );
|
||||
|
||||
|
||||
//! Load any plugins used in the last qgis session
|
||||
void restoreSessionPlugins( QString thePluginDirString );
|
||||
|
||||
//! Check whether plugin is compatible with current version of QGIS
|
||||
bool isPythonPluginCompatible( QString packageName );
|
||||
|
||||
|
||||
protected:
|
||||
//! protected constructor
|
||||
QgsPluginRegistry();
|
||||
@ -92,10 +92,10 @@ class QgsPluginRegistry
|
||||
bool checkCppPlugin( QString pluginFullPath );
|
||||
//! Try to load and get metadata from Python plugin, return true on success
|
||||
bool checkPythonPlugin( QString packageName );
|
||||
|
||||
|
||||
//! Check current QGIS version against plugin's minimal requested QGIS version
|
||||
bool checkQgisVersion(QString minVersion);
|
||||
|
||||
bool checkQgisVersion( QString minVersion );
|
||||
|
||||
private:
|
||||
static QgsPluginRegistry* _instance;
|
||||
QMap<QString, QgsPluginMetadata> mPlugins;
|
||||
|
@ -434,11 +434,11 @@ void QgsRasterLayerProperties::setMinimumMaximumEstimateWarning()
|
||||
|
||||
if ( myEstimatedValues )
|
||||
{
|
||||
lblMinMaxEstimateWarning->setText( tr("Note: Minimum Maximum values are estimates or user defined") );
|
||||
lblMinMaxEstimateWarning->setText( tr( "Note: Minimum Maximum values are estimates or user defined" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
lblMinMaxEstimateWarning->setText( tr("Note: Minimum Maximum values are actual values computed from the band(s)") );
|
||||
lblMinMaxEstimateWarning->setText( tr( "Note: Minimum Maximum values are actual values computed from the band(s)" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -484,7 +484,7 @@ void QgsServerSourceSelect::on_lstLayers_itemSelectionChanged()
|
||||
{
|
||||
QStringList parts = i->split( ":" );
|
||||
|
||||
if ( parts.at(0).compare("EPSG", Qt::CaseInsensitive) == 0 )
|
||||
if ( parts.at( 0 ).compare( "EPSG", Qt::CaseInsensitive ) == 0 )
|
||||
{
|
||||
long epsg = atol( parts.at( 1 ).toUtf8() );
|
||||
if ( epsg == m_Epsg )
|
||||
|
@ -197,32 +197,32 @@ void QgsComposerScaleBar::setStyle( const QString& styleName )
|
||||
mStyle = 0;
|
||||
|
||||
//switch depending on style name
|
||||
if ( styleName == "Single Box")
|
||||
if ( styleName == "Single Box" )
|
||||
{
|
||||
mStyle = new QgsSingleBoxScaleBarStyle( this );
|
||||
}
|
||||
else if ( styleName == "Double Box")
|
||||
else if ( styleName == "Double Box" )
|
||||
{
|
||||
mStyle = new QgsDoubleBoxScaleBarStyle( this );
|
||||
}
|
||||
else if ( styleName == "Line Ticks Middle" || styleName == "Line Ticks Down" || styleName == "Line Ticks Up" )
|
||||
{
|
||||
QgsTicksScaleBarStyle* tickStyle = new QgsTicksScaleBarStyle( this );
|
||||
if ( styleName == "Line Ticks Middle")
|
||||
if ( styleName == "Line Ticks Middle" )
|
||||
{
|
||||
tickStyle->setTickPosition( QgsTicksScaleBarStyle::TicksMiddle );
|
||||
}
|
||||
else if ( styleName == "Line Ticks Down")
|
||||
else if ( styleName == "Line Ticks Down" )
|
||||
{
|
||||
tickStyle->setTickPosition( QgsTicksScaleBarStyle::TicksDown );
|
||||
}
|
||||
else if ( styleName == "Line Ticks Up")
|
||||
else if ( styleName == "Line Ticks Up" )
|
||||
{
|
||||
tickStyle->setTickPosition( QgsTicksScaleBarStyle::TicksUp );
|
||||
}
|
||||
mStyle = tickStyle;
|
||||
}
|
||||
else if ( styleName == "Numeric")
|
||||
else if ( styleName == "Numeric" )
|
||||
{
|
||||
mStyle = new QgsNumericScaleBarStyle( this );
|
||||
}
|
||||
|
@ -418,7 +418,7 @@ class CORE_EXPORT QgsGeometry
|
||||
GEOSGeometry* nodeGeometries( const GEOSGeometry *splitLine, GEOSGeometry *poly ) const;
|
||||
|
||||
/**Returns number of single geometry in a geos geometry. Is save for geos 2 and 3*/
|
||||
int numberOfGeometries(GEOSGeometry* g) const;
|
||||
int numberOfGeometries( GEOSGeometry* g ) const;
|
||||
|
||||
int mergeGeometriesMultiTypeSplit( QVector<GEOSGeometry*>& splitResult );
|
||||
|
||||
|
@ -70,7 +70,7 @@ QgsLabelAttributes::QgsLabelAttributes( bool def )
|
||||
|
||||
setOffset( 0, 0, PointUnits );
|
||||
setAngle( 0 );
|
||||
setAutoAngle(false);
|
||||
setAutoAngle( false );
|
||||
|
||||
setAlignment( Qt::AlignCenter );
|
||||
setColor( QColor( 0, 0, 0 ) );
|
||||
@ -157,7 +157,7 @@ bool QgsLabelAttributes::angleIsAuto() const
|
||||
return mAngleIsAuto;
|
||||
}
|
||||
|
||||
void QgsLabelAttributes::setAutoAngle ( bool state )
|
||||
void QgsLabelAttributes::setAutoAngle( bool state )
|
||||
{
|
||||
mAngleIsAuto = state;
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ class CORE_EXPORT QgsLabelAttributes
|
||||
double angle( void ) const;
|
||||
|
||||
bool angleIsAuto( void ) const;
|
||||
void setAutoAngle(bool state);
|
||||
void setAutoAngle( bool state );
|
||||
|
||||
/* Alignment */
|
||||
void setAlignment( int alignment );
|
||||
|
@ -452,7 +452,7 @@ bool QgsMapLayer::loadNamedStyleFromDb( const QString db, const QString theURI,
|
||||
|
||||
QgsDebugMsg( QString( "Trying to load style for \"%1\" from \"%2\"" ).arg( theURI ).arg( db ) );
|
||||
|
||||
if( !QFile( db ).exists() )
|
||||
if ( !QFile( db ).exists() )
|
||||
return false;
|
||||
|
||||
myResult = sqlite3_open( db.toUtf8().data(), &myDatabase );
|
||||
|
@ -289,7 +289,7 @@ void QgsMapRenderer::render( QPainter* painter )
|
||||
QgsDebugMsg( " Scale dep. visibility enabled? " + QString( "%1" ).arg( ml->hasScaleBasedVisibility() ) );
|
||||
QgsDebugMsg( " Input extent: " + ml->extent().toString() );
|
||||
|
||||
if ( !ml->hasScaleBasedVisibility() || (ml->minimumScale() < mScale && mScale < ml->maximumScale() ) )
|
||||
if ( !ml->hasScaleBasedVisibility() || ( ml->minimumScale() < mScale && mScale < ml->maximumScale() ) )
|
||||
{
|
||||
connect( ml, SIGNAL( drawingProgress( int, int ) ), this, SLOT( onDrawingProgress( int, int ) ) );
|
||||
|
||||
@ -389,7 +389,7 @@ void QgsMapRenderer::render( QPainter* painter )
|
||||
{
|
||||
// only make labels if the layer is visible
|
||||
// after scale dep viewing settings are checked
|
||||
if ( !ml->hasScaleBasedVisibility() || (ml->minimumScale() < mScale && mScale < ml->maximumScale() ))
|
||||
if ( !ml->hasScaleBasedVisibility() || ( ml->minimumScale() < mScale && mScale < ml->maximumScale() ) )
|
||||
{
|
||||
bool split = false;
|
||||
|
||||
|
@ -52,12 +52,12 @@ int QgsSnapper::snapPoint( const QPoint& startPoint, QList<QgsSnappingResult>& s
|
||||
QgsSnappingResult newResult;
|
||||
|
||||
QList<QgsSnapper::SnapLayer>::iterator snapLayerIt;
|
||||
for (snapLayerIt = mSnapLayers.begin(); snapLayerIt != mSnapLayers.end(); ++snapLayerIt )
|
||||
for ( snapLayerIt = mSnapLayers.begin(); snapLayerIt != mSnapLayers.end(); ++snapLayerIt )
|
||||
{
|
||||
//transform point from map coordinates to layer coordinates
|
||||
layerCoordPoint = mMapRenderer->mapToLayerCoordinates( snapLayerIt->mLayer, mapCoordPoint );
|
||||
if ( snapLayerIt->mLayer->snapWithContext( layerCoordPoint, snapLayerIt->mTolerance,
|
||||
currentResultList, snapLayerIt->mSnapTo ) != 0 )
|
||||
currentResultList, snapLayerIt->mSnapTo ) != 0 )
|
||||
{
|
||||
//error
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ class CORE_EXPORT QgsSnapper
|
||||
/**What snapping type to use (snap to segment or to vertex)*/
|
||||
QgsSnapper::SnappingType mSnapTo;
|
||||
};
|
||||
|
||||
|
||||
QgsSnapper( QgsMapRenderer* mapRender );
|
||||
~QgsSnapper();
|
||||
/**Does the snapping operation
|
||||
|
@ -64,10 +64,10 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
|
||||
RandomSelectGeometryAtId = 1 << 10,
|
||||
SequentialSelectGeometryAtId = 1 << 11
|
||||
};
|
||||
|
||||
|
||||
/** bitmask of all provider's editing capabilities */
|
||||
const static int EditingCapabilities = AddFeatures | DeleteFeatures |
|
||||
ChangeAttributeValues | ChangeGeometries | AddAttributes | DeleteAttributes;
|
||||
ChangeAttributeValues | ChangeGeometries | AddAttributes | DeleteAttributes;
|
||||
|
||||
/**
|
||||
* Constructor of the vector provider
|
||||
|
@ -1164,7 +1164,7 @@ void QgsVectorLayer::updateFeatureAttributes( QgsFeature &f )
|
||||
// remove all attributes that will disappear
|
||||
const QgsAttributeMap &map = f.attributeMap();
|
||||
for ( QgsAttributeMap::const_iterator it = map.begin(); it != map.end(); it++ )
|
||||
if( !mUpdatedFields.contains( it.key() ) )
|
||||
if ( !mUpdatedFields.contains( it.key() ) )
|
||||
f.deleteAttribute( it.key() );
|
||||
|
||||
// null/add all attributes that were added, but don't exist in the feature yet
|
||||
@ -2641,7 +2641,7 @@ bool QgsVectorLayer::commitChanges()
|
||||
{
|
||||
QgsNewAttributesMap addedAttributes;
|
||||
for ( QgsAttributeIds::const_iterator it = mAddedAttributeIds.begin(); it != mAddedAttributeIds.end(); it++ )
|
||||
addedAttributes[ mUpdatedFields[ *it ].name() ] = mUpdatedFields[ *it ].typeName();
|
||||
addedAttributes[ mUpdatedFields[ *it ].name()] = mUpdatedFields[ *it ].typeName();
|
||||
|
||||
if (( cap & QgsVectorDataProvider::AddAttributes ) && mDataProvider->addAttributes( addedAttributes ) )
|
||||
{
|
||||
@ -2666,7 +2666,7 @@ bool QgsVectorLayer::commitChanges()
|
||||
QMap<int, QString> src;
|
||||
for ( QgsFieldMap::const_iterator it = mUpdatedFields.begin(); it != mUpdatedFields.end(); it++ )
|
||||
{
|
||||
src[ it.key() ] = it.value().name();
|
||||
src[ it.key()] = it.value().name();
|
||||
}
|
||||
|
||||
int maxAttrIdx = -1;
|
||||
@ -2676,7 +2676,7 @@ bool QgsVectorLayer::commitChanges()
|
||||
QMap<QString, int> dst;
|
||||
for ( QgsFieldMap::const_iterator it = pFields.begin(); it != pFields.end(); it++ )
|
||||
{
|
||||
dst[ it.value().name() ] = it.key();
|
||||
dst[ it.value().name()] = it.key();
|
||||
if ( it.key() > maxAttrIdx )
|
||||
maxAttrIdx = it.key();
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
|
||||
void invertSelection();
|
||||
|
||||
/** Invert selection of features found within the search rectangle (in layer's coordinates) */
|
||||
void invertSelectionInRectangle( QgsRectangle & rect);
|
||||
void invertSelectionInRectangle( QgsRectangle & rect );
|
||||
|
||||
/** Get a copy of the user-selected features */
|
||||
QgsFeatureList selectedFeatures();
|
||||
|
@ -122,8 +122,8 @@ QImage QgsMarkerCatalogue::imageMarker( QString fullName, double size, QPen pen,
|
||||
int imageSize;
|
||||
if ( fullName.left( 5 ) == "hard:" )
|
||||
{
|
||||
int pw = ( ( pen.width()==0 ? 1 : pen.width() ) + 1 ) / 2 * 2; // make even (round up); handle cosmetic pen
|
||||
imageSize = ( (int) size + pw ) / 2 * 2 + 1; // make image width, height odd; account for pen width
|
||||
int pw = (( pen.width() == 0 ? 1 : pen.width() ) + 1 ) / 2 * 2; // make even (round up); handle cosmetic pen
|
||||
imageSize = (( int ) size + pw ) / 2 * 2 + 1; // make image width, height odd; account for pen width
|
||||
myImage = QImage( imageSize, imageSize, QImage::Format_ARGB32_Premultiplied );
|
||||
}
|
||||
else
|
||||
@ -131,7 +131,7 @@ QImage QgsMarkerCatalogue::imageMarker( QString fullName, double size, QPen pen,
|
||||
// TODO Change this logic so width is size and height is same
|
||||
// proportion of scale factor as in oritignal SVG TS XXX
|
||||
//QPixmap myPixmap = QPixmap(width,height);
|
||||
imageSize = ( (int) size ) / 2 * 2 + 1; // make image width, height odd
|
||||
imageSize = (( int ) size ) / 2 * 2 + 1; // make image width, height odd
|
||||
myImage = QImage( imageSize, imageSize, QImage::Format_ARGB32_Premultiplied );
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ QPicture QgsMarkerCatalogue::pictureMarker( QString fullName, double size, QPen
|
||||
|
||||
if ( fullName.left( 5 ) == "hard:" )
|
||||
{
|
||||
hardMarker( &myPainter, (int) size, fullName.mid( 5 ), size, pen, brush, qtBug );
|
||||
hardMarker( &myPainter, ( int ) size, fullName.mid( 5 ), size, pen, brush, qtBug );
|
||||
return myPicture;
|
||||
}
|
||||
else if ( fullName.left( 4 ) == "svg:" )
|
||||
@ -219,20 +219,20 @@ void QgsMarkerCatalogue::hardMarker( QPainter * thepPainter, int imageSize, QStr
|
||||
// around a circle with diameter mPointSize
|
||||
|
||||
#if 0
|
||||
s = s - pen.widthF(); // to make the overall size of the symbol at the specified size
|
||||
s = s - pen.widthF(); // to make the overall size of the symbol at the specified size
|
||||
#else
|
||||
// the size of the base symbol is at the specified size; the outline is applied additionally
|
||||
#endif
|
||||
|
||||
// Circle radius, is used for other figures also, when compensating for line
|
||||
// width is necessary.
|
||||
double r = s / 2; // get half the size of the figure to be rendered (the radius)
|
||||
double r = s / 2; // get half the size of the figure to be rendered (the radius)
|
||||
|
||||
QgsDebugMsg( QString( "Hard marker size %1" ).arg( s ) );
|
||||
|
||||
// Find out center coordinates of the QImage to draw on.
|
||||
double x_c = (double) ( imageSize / 2 ) + 0.5; // add 1/2 pixel for proper rounding when the figure's coordinates are added
|
||||
double y_c = x_c; // is square image
|
||||
double x_c = ( double )( imageSize / 2 ) + 0.5; // add 1/2 pixel for proper rounding when the figure's coordinates are added
|
||||
double y_c = x_c; // is square image
|
||||
|
||||
thepPainter->setPen( pen );
|
||||
thepPainter->setBrush( brush );
|
||||
@ -245,29 +245,29 @@ void QgsMarkerCatalogue::hardMarker( QPainter * thepPainter, int imageSize, QStr
|
||||
// "A stroked ellipse has a size of rectangle.size() plus the pen width."
|
||||
// (from Qt doc)
|
||||
|
||||
thepPainter->drawEllipse( QRectF( x_c - r, y_c - r, s, s ) ); // x,y,w,h
|
||||
thepPainter->drawEllipse( QRectF( x_c - r, y_c - r, s, s ) ); // x,y,w,h
|
||||
}
|
||||
else if ( name == "rectangle" )
|
||||
{
|
||||
thepPainter->drawRect( QRectF( x_c - r, y_c - r, s, s ) ); // x,y,w,h
|
||||
thepPainter->drawRect( QRectF( x_c - r, y_c - r, s, s ) ); // x,y,w,h
|
||||
}
|
||||
else if ( name == "diamond" )
|
||||
{
|
||||
QPolygonF pa;
|
||||
pa << QPointF( x_c - r, y_c )
|
||||
<< QPointF( x_c, y_c + r )
|
||||
<< QPointF( x_c + r, y_c )
|
||||
<< QPointF( x_c, y_c - r );
|
||||
<< QPointF( x_c, y_c + r )
|
||||
<< QPointF( x_c + r, y_c )
|
||||
<< QPointF( x_c, y_c - r );
|
||||
thepPainter->drawPolygon( pa );
|
||||
}
|
||||
else if ( name == "pentagon" )
|
||||
{
|
||||
QPolygonF pa;
|
||||
pa << QPointF( x_c + ( r * sin( DEG2RAD( 288.0 ) ) ), y_c - ( r * cos( DEG2RAD( 288.0 ) ) ) )
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 216.0 ) ) ), y_c - ( r * cos( DEG2RAD( 216.0 ) ) ) )
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 144.0 ) ) ), y_c - ( r * cos( DEG2RAD( 144.0 ) ) ) )
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 72.0 ) ) ), y_c - ( r * cos( DEG2RAD( 72.0 ) ) ) )
|
||||
<< QPointF( x_c, y_c - r );
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 216.0 ) ) ), y_c - ( r * cos( DEG2RAD( 216.0 ) ) ) )
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 144.0 ) ) ), y_c - ( r * cos( DEG2RAD( 144.0 ) ) ) )
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 72.0 ) ) ), y_c - ( r * cos( DEG2RAD( 72.0 ) ) ) )
|
||||
<< QPointF( x_c, y_c - r );
|
||||
thepPainter->drawPolygon( pa );
|
||||
}
|
||||
else if ( name == "cross" )
|
||||
@ -284,16 +284,16 @@ void QgsMarkerCatalogue::hardMarker( QPainter * thepPainter, int imageSize, QStr
|
||||
{
|
||||
QPolygonF pa;
|
||||
pa << QPointF( x_c - r, y_c + r )
|
||||
<< QPointF( x_c + r, y_c + r )
|
||||
<< QPointF( x_c, y_c - r );
|
||||
<< QPointF( x_c + r, y_c + r )
|
||||
<< QPointF( x_c, y_c - r );
|
||||
thepPainter->drawPolygon( pa );
|
||||
}
|
||||
else if ( name == "equilateral_triangle" )
|
||||
{
|
||||
QPolygonF pa;
|
||||
pa << QPointF( x_c + ( r * sin( DEG2RAD( 240.0 ) ) ), y_c - ( r * cos( DEG2RAD( 240.0 ) ) ) )
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 120.0 ) ) ), y_c - ( r * cos( DEG2RAD( 120.0 ) ) ) )
|
||||
<< QPointF( x_c, y_c - r ); // 0
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 120.0 ) ) ), y_c - ( r * cos( DEG2RAD( 120.0 ) ) ) )
|
||||
<< QPointF( x_c, y_c - r ); // 0
|
||||
thepPainter->drawPolygon( pa );
|
||||
}
|
||||
else if ( name == "star" )
|
||||
@ -302,15 +302,15 @@ void QgsMarkerCatalogue::hardMarker( QPainter * thepPainter, int imageSize, QStr
|
||||
|
||||
QPolygonF pa;
|
||||
pa << QPointF( x_c, y_c - r )
|
||||
<< QPointF( x_c - oneSixth, y_c - oneSixth )
|
||||
<< QPointF( x_c - r, y_c - oneSixth )
|
||||
<< QPointF( x_c - oneSixth, y_c )
|
||||
<< QPointF( x_c - r, y_c + r )
|
||||
<< QPointF( x_c, y_c + oneSixth )
|
||||
<< QPointF( x_c + r, y_c + r )
|
||||
<< QPointF( x_c + oneSixth, y_c )
|
||||
<< QPointF( x_c + r, y_c - oneSixth )
|
||||
<< QPointF( x_c + oneSixth, y_c - oneSixth );
|
||||
<< QPointF( x_c - oneSixth, y_c - oneSixth )
|
||||
<< QPointF( x_c - r, y_c - oneSixth )
|
||||
<< QPointF( x_c - oneSixth, y_c )
|
||||
<< QPointF( x_c - r, y_c + r )
|
||||
<< QPointF( x_c, y_c + oneSixth )
|
||||
<< QPointF( x_c + r, y_c + r )
|
||||
<< QPointF( x_c + oneSixth, y_c )
|
||||
<< QPointF( x_c + r, y_c - oneSixth )
|
||||
<< QPointF( x_c + oneSixth, y_c - oneSixth );
|
||||
thepPainter->drawPolygon( pa );
|
||||
}
|
||||
else if ( name == "regular_star" )
|
||||
@ -319,16 +319,16 @@ void QgsMarkerCatalogue::hardMarker( QPainter * thepPainter, int imageSize, QStr
|
||||
double inner_r = r * cos( DEG2RAD( 72.0 ) ) / cos( DEG2RAD( 36.0 ) );
|
||||
|
||||
QPolygonF pa;
|
||||
pa << QPointF( x_c + ( inner_r * sin( DEG2RAD( 324.0 ) ) ), y_c - ( inner_r * cos( DEG2RAD( 324.0 ) ) ) ) // 324
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 288.0 ) ) ), y_c - ( r * cos( DEG2RAD( 288 ) ) ) ) // 288
|
||||
<< QPointF( x_c + ( inner_r * sin( DEG2RAD( 252.0 ) ) ), y_c - ( inner_r * cos( DEG2RAD( 252.0 ) ) ) ) // 252
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 216.0 ) ) ), y_c - ( r * cos( DEG2RAD( 216.0 ) ) ) ) // 216
|
||||
<< QPointF( x_c, y_c + ( inner_r ) ) // 180
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 144.0 ) ) ), y_c - ( r * cos( DEG2RAD( 144.0 ) ) ) ) // 144
|
||||
<< QPointF( x_c + ( inner_r * sin( DEG2RAD( 108.0 ) ) ), y_c - ( inner_r * cos( DEG2RAD( 108.0 ) ) ) ) // 108
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 72.0 ) ) ), y_c - ( r * cos( DEG2RAD( 72.0 ) ) ) ) // 72
|
||||
<< QPointF( x_c + ( inner_r * sin( DEG2RAD( 36.0 ) ) ), y_c - ( inner_r * cos( DEG2RAD( 36.0 ) ) ) ) // 36
|
||||
<< QPointF( x_c, y_c - r ); // 0
|
||||
pa << QPointF( x_c + ( inner_r * sin( DEG2RAD( 324.0 ) ) ), y_c - ( inner_r * cos( DEG2RAD( 324.0 ) ) ) ) // 324
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 288.0 ) ) ), y_c - ( r * cos( DEG2RAD( 288 ) ) ) ) // 288
|
||||
<< QPointF( x_c + ( inner_r * sin( DEG2RAD( 252.0 ) ) ), y_c - ( inner_r * cos( DEG2RAD( 252.0 ) ) ) ) // 252
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 216.0 ) ) ), y_c - ( r * cos( DEG2RAD( 216.0 ) ) ) ) // 216
|
||||
<< QPointF( x_c, y_c + ( inner_r ) ) // 180
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 144.0 ) ) ), y_c - ( r * cos( DEG2RAD( 144.0 ) ) ) ) // 144
|
||||
<< QPointF( x_c + ( inner_r * sin( DEG2RAD( 108.0 ) ) ), y_c - ( inner_r * cos( DEG2RAD( 108.0 ) ) ) ) // 108
|
||||
<< QPointF( x_c + ( r * sin( DEG2RAD( 72.0 ) ) ), y_c - ( r * cos( DEG2RAD( 72.0 ) ) ) ) // 72
|
||||
<< QPointF( x_c + ( inner_r * sin( DEG2RAD( 36.0 ) ) ), y_c - ( inner_r * cos( DEG2RAD( 36.0 ) ) ) ) // 36
|
||||
<< QPointF( x_c, y_c - r ); // 0
|
||||
thepPainter->drawPolygon( pa );
|
||||
}
|
||||
else if ( name == "arrow" )
|
||||
@ -338,12 +338,12 @@ void QgsMarkerCatalogue::hardMarker( QPainter * thepPainter, int imageSize, QStr
|
||||
|
||||
QPolygonF pa;
|
||||
pa << QPointF( x_c, y_c - r )
|
||||
<< QPointF( x_c + quarter, y_c - quarter )
|
||||
<< QPointF( x_c + oneEight, y_c - quarter )
|
||||
<< QPointF( x_c + oneEight, y_c + r )
|
||||
<< QPointF( x_c - oneEight, y_c + r )
|
||||
<< QPointF( x_c - oneEight, y_c - quarter )
|
||||
<< QPointF( x_c - quarter, y_c - quarter );
|
||||
<< QPointF( x_c + quarter, y_c - quarter )
|
||||
<< QPointF( x_c + oneEight, y_c - quarter )
|
||||
<< QPointF( x_c + oneEight, y_c + r )
|
||||
<< QPointF( x_c - oneEight, y_c + r )
|
||||
<< QPointF( x_c - oneEight, y_c - quarter )
|
||||
<< QPointF( x_c - quarter, y_c - quarter );
|
||||
thepPainter->drawPolygon( pa );
|
||||
}
|
||||
thepPainter->end();
|
||||
|
@ -485,7 +485,7 @@ int QgsSymbol::readFieldName( QDomNode &synode, QString name, const QgsVectorLay
|
||||
QString name = node.toElement().text();
|
||||
|
||||
for ( QgsFieldMap::const_iterator it = fields.begin(); it != fields.end(); it++ )
|
||||
if( it->name() == name )
|
||||
if ( it->name() == name )
|
||||
return it.key();
|
||||
|
||||
return -1;
|
||||
|
@ -860,7 +860,7 @@ void QgsMapCanvas::wheelEvent( QWheelEvent *e )
|
||||
{
|
||||
case WheelZoom:
|
||||
// zoom without changing extent
|
||||
if (e->delta() > 0)
|
||||
if ( e->delta() > 0 )
|
||||
zoomIn();
|
||||
else
|
||||
zoomOut();
|
||||
|
@ -215,7 +215,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
|
||||
|
||||
//! Zoom out with fixed factor
|
||||
void zoomOut( );
|
||||
|
||||
|
||||
//! Zoom with the factor supplied. Factor > 1 zooms in
|
||||
void zoomByFactor( double scaleFactor );
|
||||
|
||||
|
@ -206,7 +206,7 @@ int QgsMapCanvasSnapper::snapToBackgroundLayers( const QPoint& p, QList<QgsSnapp
|
||||
snapLayer.mSnapTo = QgsSnapper::SnapToVertexAndSegment;
|
||||
}
|
||||
|
||||
snapLayers.append(snapLayer);
|
||||
snapLayers.append( snapLayer );
|
||||
}
|
||||
}
|
||||
else //nothing in project. Use default snapping tolerance to vertex of current layer
|
||||
@ -243,8 +243,8 @@ int QgsMapCanvasSnapper::snapToBackgroundLayers( const QPoint& p, QList<QgsSnapp
|
||||
|
||||
//default snapping tolerance
|
||||
snapLayer.mTolerance = settings.value( "/qgis/digitizing/default_snapping_tolerance", 0 ).toDouble();
|
||||
|
||||
snapLayers.append(snapLayer);
|
||||
|
||||
snapLayers.append( snapLayer );
|
||||
}
|
||||
|
||||
mSnapper->setSnapLayers( snapLayers );
|
||||
|
@ -132,7 +132,7 @@ QString QgsProjectionSelector::ogcWmsCrsFilterAsSqlExpression( QSet<QString> * c
|
||||
{
|
||||
QStringList parts = i->split( ":" );
|
||||
|
||||
if ( parts.at( 0 ) == "EPSG" && parts.size()>=2 )
|
||||
if ( parts.at( 0 ) == "EPSG" && parts.size() >= 2 )
|
||||
{
|
||||
epsgParts.push_back( parts.at( 1 ) );
|
||||
}
|
||||
|
@ -178,14 +178,14 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
|
||||
mIsPolygon = true;
|
||||
double d = mMapCanvas->extent().width() * 0.005;
|
||||
QgsPoint pt;
|
||||
if(layer)
|
||||
{
|
||||
pt = mr->layerToMapCoordinates( layer, geom->asPoint() );
|
||||
}
|
||||
if ( layer )
|
||||
{
|
||||
pt = mr->layerToMapCoordinates( layer, geom->asPoint() );
|
||||
}
|
||||
else
|
||||
{
|
||||
pt = geom->asPoint();
|
||||
}
|
||||
{
|
||||
pt = geom->asPoint();
|
||||
}
|
||||
addPoint( QgsPoint( pt.x() - d, pt.y() - d ) );
|
||||
addPoint( QgsPoint( pt.x() + d, pt.y() - d ) );
|
||||
addPoint( QgsPoint( pt.x() + d, pt.y() + d ) );
|
||||
@ -202,20 +202,20 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
|
||||
for ( int i = 0; i < mpt.size(); ++i )
|
||||
{
|
||||
QgsPoint pt = mpt[i];
|
||||
if(layer)
|
||||
{
|
||||
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() - d ) ) );
|
||||
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() - d ) ) );
|
||||
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() + d ) ) );
|
||||
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() + d ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
addPoint(QgsPoint( pt.x() - d, pt.y() - d ) );
|
||||
addPoint(QgsPoint( pt.x() + d, pt.y() - d ) );
|
||||
addPoint(QgsPoint( pt.x() + d, pt.y() + d ) );
|
||||
addPoint(QgsPoint( pt.x() - d, pt.y() + d ) );
|
||||
}
|
||||
if ( layer )
|
||||
{
|
||||
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() - d ) ) );
|
||||
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() - d ) ) );
|
||||
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() + d, pt.y() + d ) ) );
|
||||
addPoint( mr->layerToMapCoordinates( layer, QgsPoint( pt.x() - d, pt.y() + d ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
addPoint( QgsPoint( pt.x() - d, pt.y() - d ) );
|
||||
addPoint( QgsPoint( pt.x() + d, pt.y() - d ) );
|
||||
addPoint( QgsPoint( pt.x() + d, pt.y() + d ) );
|
||||
addPoint( QgsPoint( pt.x() - d, pt.y() + d ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -227,14 +227,14 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
|
||||
QgsPolyline line = geom->asPolyline();
|
||||
for ( int i = 0; i < line.count(); i++ )
|
||||
{
|
||||
if(layer)
|
||||
{
|
||||
addPoint( mr->layerToMapCoordinates( layer, line[i] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
addPoint(line[i]);
|
||||
}
|
||||
if ( layer )
|
||||
{
|
||||
addPoint( mr->layerToMapCoordinates( layer, line[i] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
addPoint( line[i] );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -253,14 +253,14 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
|
||||
QgsPolyline line = mline[i];
|
||||
for ( int j = 0; j < line.size(); ++j )
|
||||
{
|
||||
if(layer)
|
||||
{
|
||||
addPoint( mr->layerToMapCoordinates( layer, line[j] ), false, i );
|
||||
}
|
||||
else
|
||||
{
|
||||
addPoint(line[j]);
|
||||
}
|
||||
if ( layer )
|
||||
{
|
||||
addPoint( mr->layerToMapCoordinates( layer, line[j] ), false, i );
|
||||
}
|
||||
else
|
||||
{
|
||||
addPoint( line[j] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -274,14 +274,14 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
|
||||
QgsPolyline line = poly[0];
|
||||
for ( int i = 0; i < line.count(); i++ )
|
||||
{
|
||||
if(layer)
|
||||
{
|
||||
addPoint( mr->layerToMapCoordinates( layer, line[i] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
addPoint(line[i]);
|
||||
}
|
||||
if ( layer )
|
||||
{
|
||||
addPoint( mr->layerToMapCoordinates( layer, line[i] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
addPoint( line[i] );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -301,14 +301,14 @@ void QgsRubberBand::setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer )
|
||||
QgsPolyline line = poly[0];
|
||||
for ( int j = 0; j < line.count(); ++j )
|
||||
{
|
||||
if(layer)
|
||||
{
|
||||
addPoint( mr->layerToMapCoordinates( layer, line[j] ), false, i );
|
||||
}
|
||||
else
|
||||
{
|
||||
addPoint(line[j]);
|
||||
}
|
||||
if ( layer )
|
||||
{
|
||||
addPoint( mr->layerToMapCoordinates( layer, line[j] ), false, i );
|
||||
}
|
||||
else
|
||||
{
|
||||
addPoint( line[j] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ class GUI_EXPORT QgsRubberBand: public QgsMapCanvasItem
|
||||
/**Sets this rubber band to the geometry of an existing feature.
|
||||
This is usefull for feature highlighting.
|
||||
@param geom the geometry object
|
||||
@param layer the layer containing the feature, used for coord transformation to map
|
||||
@param layer the layer containing the feature, used for coord transformation to map
|
||||
crs. In case of 0 pointer, the coordinates are not going to be transformed.
|
||||
@param render the maprender object (used for coord transformation)*/
|
||||
void setToGeometry( QgsGeometry* geom, QgsVectorLayer* layer );
|
||||
|
@ -1045,7 +1045,7 @@ int QgsGrassProvider::openMap( QString gisdbase, QString location, QString mapse
|
||||
( ( GRASS_VERSION_MAJOR == 6 && GRASS_VERSION_MINOR >= 4 ) || GRASS_VERSION_MAJOR > 6 )
|
||||
Vect_build( map.map );
|
||||
#else
|
||||
Vect_build( map.map, stderr );
|
||||
Vect_build( map.map, stderr );
|
||||
#endif
|
||||
|
||||
if ( QgsGrass::getError() == QgsGrass::FATAL )
|
||||
@ -1528,8 +1528,8 @@ bool QgsGrassProvider::closeEdit( bool newMap )
|
||||
#if defined(GRASS_VERSION_MAJOR) && defined(GRASS_VERSION_MINOR) && \
|
||||
( ( GRASS_VERSION_MAJOR == 6 && GRASS_VERSION_MINOR >= 4 ) || GRASS_VERSION_MAJOR > 6 )
|
||||
Vect_build_partial( map->map, GV_BUILD_NONE );
|
||||
Vect_build( map->map );
|
||||
#else
|
||||
Vect_build( map->map );
|
||||
#else
|
||||
Vect_build_partial( map->map, GV_BUILD_NONE, NULL );
|
||||
Vect_build( map->map, stderr );
|
||||
#endif
|
||||
|
@ -423,9 +423,9 @@ bool QgsPostgresProvider::declareCursor(
|
||||
{
|
||||
query += QString( ",boolout(%1)" ).arg( quotedIdentifier( fieldname ) );
|
||||
}
|
||||
else if ( type == "geometry")
|
||||
else if ( type == "geometry" )
|
||||
{
|
||||
query += QString(",asewkt(%1)").arg(quotedIdentifier(fieldname));
|
||||
query += QString( ",asewkt(%1)" ).arg( quotedIdentifier( fieldname ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1806,9 +1806,9 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList & flist )
|
||||
values += "," + defVal;
|
||||
}
|
||||
}
|
||||
else if( fit->typeName()=="geometry" )
|
||||
else if ( fit->typeName() == "geometry" )
|
||||
{
|
||||
values += QString(",geomfromewkt(%1)").arg( quotedValue( it->toString() ) );
|
||||
values += QString( ",geomfromewkt(%1)" ).arg( quotedValue( it->toString() ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1818,7 +1818,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList & flist )
|
||||
else
|
||||
{
|
||||
// value is not unique => add parameter
|
||||
if( fit->typeName()=="geometry" )
|
||||
if ( fit->typeName() == "geometry" )
|
||||
{
|
||||
values += QString( ",geomfromewkt($%1)" ).arg( defaultValues.size() + 3 );
|
||||
}
|
||||
@ -2054,7 +2054,7 @@ bool QgsPostgresProvider::changeAttributeValues( const QgsChangedAttributesMap &
|
||||
else
|
||||
first = false;
|
||||
|
||||
sql += QString( fld.typeName()!="geometry" ? "%1=%2" : "%1=geomfromewkt(%2)" )
|
||||
sql += QString( fld.typeName() != "geometry" ? "%1=%2" : "%1=geomfromewkt(%2)" )
|
||||
.arg( quotedIdentifier( fld.name() ) )
|
||||
.arg( quotedValue( siter->toString() ) );
|
||||
}
|
||||
@ -2565,7 +2565,7 @@ bool QgsPostgresProvider::getGeometryDetails()
|
||||
tr( ". The database communication log was:\n" ) );
|
||||
showMessageBox( tr( "Unable to get feature type and srid" ), log );
|
||||
}
|
||||
|
||||
|
||||
// store whether the geometry includes measure value
|
||||
if ( fType == "POINTM" || fType == "MULTIPOINTM" ||
|
||||
fType == "LINESTRINGM" || fType == "MULTILINESTRINGM" ||
|
||||
@ -2573,10 +2573,10 @@ bool QgsPostgresProvider::getGeometryDetails()
|
||||
{
|
||||
// explicitly disable adding new features and editing of geometries
|
||||
// as this would lead to corruption of measures
|
||||
enabledCapabilities &= ~(QgsVectorDataProvider::ChangeGeometries | QgsVectorDataProvider::AddFeatures);
|
||||
enabledCapabilities &= ~( QgsVectorDataProvider::ChangeGeometries | QgsVectorDataProvider::AddFeatures );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ( valid )
|
||||
{
|
||||
QgsDebugMsg( "SRID is " + srid );
|
||||
@ -2670,10 +2670,10 @@ bool QgsPostgresProvider::Conn::PQexecNR( QString query )
|
||||
.arg( PQresultErrorMessage( res ) );
|
||||
QgsDebugMsgLevel( err, 3 );
|
||||
#endif
|
||||
if( openCursors )
|
||||
if ( openCursors )
|
||||
{
|
||||
PQexecNR( "ROLLBACK" );
|
||||
QgsDebugMsg( QString("Re-starting read-only transaction after errornous statement - state of %1 cursors lost" ).arg( openCursors ) );
|
||||
QgsDebugMsg( QString( "Re-starting read-only transaction after errornous statement - state of %1 cursors lost" ).arg( openCursors ) );
|
||||
PQexecNR( "BEGIN READ ONLY" );
|
||||
}
|
||||
}
|
||||
|
@ -381,7 +381,7 @@ QImage* QgsWmsProvider::draw( QgsRectangle const & viewExtent, int pixelWidth,
|
||||
|
||||
QString url;
|
||||
std::vector<QgsWmsDcpTypeProperty> dcpType = mCapabilities.capability.request.getMap.dcpType;
|
||||
if(dcpType.size() < 1)
|
||||
if ( dcpType.size() < 1 )
|
||||
{
|
||||
url = baseUrl;
|
||||
}
|
||||
|
@ -87,17 +87,17 @@ void QgsPythonUtilsImpl::initPython( QgisInterface* interface )
|
||||
runString(
|
||||
"def qgis_except_hook_msg(type, value, tb, msg):\n"
|
||||
" lst = traceback.format_exception(type, value, tb)\n"
|
||||
" if msg == None: msg = '" + QObject::tr( "An error has occured while executing Python code:" ).replace("'", "\\'") + "'\n"
|
||||
" if msg == None: msg = '" + QObject::tr( "An error has occured while executing Python code:" ).replace( "'", "\\'" ) + "'\n"
|
||||
" txt = '<font color=\"red\">'+msg+'</font><br><br>'\n"
|
||||
" for s in lst:\n"
|
||||
" txt += s\n"
|
||||
" txt += '<br>" + QObject::tr( "Python version:" ).replace("'", "\\'") + "<br>' + sys.version + '<br><br>'\n"
|
||||
" txt += '" + QObject::tr( "Python path:" ).replace("'", "\\'") + "' + str(sys.path)\n"
|
||||
" txt += '<br>" + QObject::tr( "Python version:" ).replace( "'", "\\'" ) + "<br>' + sys.version + '<br><br>'\n"
|
||||
" txt += '" + QObject::tr( "Python path:" ).replace( "'", "\\'" ) + "' + str(sys.path)\n"
|
||||
" txt = txt.replace('\\n', '<br>')\n"
|
||||
" txt = txt.replace(' ', ' ')\n" // preserve whitespaces for nicer output
|
||||
" \n"
|
||||
" msg = QgsMessageOutput.createMessageOutput()\n"
|
||||
" msg.setTitle('" + QObject::tr( "Python error" ).replace("'", "\\'") + "')\n"
|
||||
" msg.setTitle('" + QObject::tr( "Python error" ).replace( "'", "\\'" ) + "')\n"
|
||||
" msg.setMessage(txt, QgsMessageOutput.MessageHtml)\n"
|
||||
" msg.showMessage()\n" );
|
||||
runString(
|
||||
@ -427,7 +427,7 @@ QString QgsPythonUtilsImpl::getPluginMetadata( QString pluginName, QString funct
|
||||
// temporary disable error hook - UI will handle this gracefully
|
||||
uninstallErrorHook();
|
||||
PyObject* obj = PyRun_String( command.toLocal8Bit().data(), Py_eval_input, mMainDict, mMainDict );
|
||||
|
||||
|
||||
if ( PyErr_Occurred() )
|
||||
{
|
||||
PyErr_Print(); // just print it to console
|
||||
@ -437,7 +437,7 @@ QString QgsPythonUtilsImpl::getPluginMetadata( QString pluginName, QString funct
|
||||
else if ( PyUnicode_Check( obj ) )
|
||||
{
|
||||
PyObject* utf8 = PyUnicode_AsUTF8String( obj );
|
||||
if (utf8)
|
||||
if ( utf8 )
|
||||
retval = QString::fromUtf8( PyString_AS_STRING( utf8 ) );
|
||||
else
|
||||
retval = "__error__";
|
||||
@ -453,7 +453,7 @@ QString QgsPythonUtilsImpl::getPluginMetadata( QString pluginName, QString funct
|
||||
retval = "__error__";
|
||||
}
|
||||
Py_XDECREF( obj );
|
||||
|
||||
|
||||
installErrorHook();
|
||||
return retval;
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ class QgsPythonUtilsImpl : public QgsPythonUtils
|
||||
void installErrorHook();
|
||||
|
||||
void uninstallErrorHook();
|
||||
|
||||
|
||||
QString getTraceback();
|
||||
|
||||
//! reference to module __main__
|
||||
|
Loading…
x
Reference in New Issue
Block a user