Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of github.com:qgis/Quantum-GIS
  • Loading branch information
timlinux committed Aug 10, 2011
2 parents 89ddd03 + 7acce88 commit 3ab4c13
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 11 deletions.
25 changes: 25 additions & 0 deletions src/app/qgsconfigureshortcutsdialog.cpp
Expand Up @@ -43,8 +43,33 @@ QgsConfigureShortcutsDialog::QgsConfigureShortcutsDialog( QWidget* parent )
this, SLOT( actionChanged( QTreeWidgetItem*, QTreeWidgetItem* ) ) );

populateActions();

restoreState();
}

QgsConfigureShortcutsDialog::~QgsConfigureShortcutsDialog()
{
saveState();
}

/*!
* Function to save dialog window state
*/
void QgsConfigureShortcutsDialog::saveState()
{
QSettings settings;
settings.setValue( "/Windows/ShortcutsDialog/geometry", saveGeometry() );
}

/*!
* Function to restore dialog window state
*/
void QgsConfigureShortcutsDialog::restoreState()
{
QSettings settings;
restoreGeometry( settings.value( "/Windows/ShortcutsDialog/geometry" ).toByteArray() );
}

void QgsConfigureShortcutsDialog::populateActions()
{
QList<QAction*> actions = QgsShortcutsManager::instance()->listActions();
Expand Down
15 changes: 14 additions & 1 deletion src/app/qgsconfigureshortcutsdialog.h
Expand Up @@ -26,7 +26,8 @@ class QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsConfigureShor

public:
QgsConfigureShortcutsDialog( QWidget* parent = NULL );

~QgsConfigureShortcutsDialog();

void populateActions();

protected:
Expand All @@ -51,6 +52,18 @@ class QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsConfigureShor
protected:
bool mGettingShortcut;
int mModifiers, mKey;

private:
/*!
* Function to save dialog window state
*/
void saveState();

/*!
* Function to restore dialog window state
*/
void restoreState();

};

#endif
2 changes: 1 addition & 1 deletion src/mapserver/qgsconfigparser.cpp
Expand Up @@ -140,7 +140,7 @@ QStringList QgsConfigParser::createCRSListForLayer( QgsMapLayer* theMapLayer ) c

//check the db is available
myResult = sqlite3_open( myDatabaseFileName.toLocal8Bit().data(), &myDatabase );
if ( myResult )
if ( myResult && theMapLayer )
{
//if the database cannot be opened, add at least the epsg number of the source coordinate system
crsNumbers.push_back( theMapLayer->crs().authid() );
Expand Down
11 changes: 2 additions & 9 deletions src/mapserver/qgsprojectparser.cpp
Expand Up @@ -102,15 +102,8 @@ void QgsProjectParser::layersAndStylesCapabilities( QDomElement& parentElement,
layerParentTitleElem.appendChild( layerParentTitleText );
layerParentElem.appendChild( layerParentTitleElem );

QSet<QString> crsSet = supportedOutputCrsSet();
QSet<QString>::const_iterator crsIt = crsSet.constBegin();
for(; crsIt != crsSet.constEnd(); ++crsIt )
{
QDomElement crsElem = doc.createElement("CRS");
QDomText crsText = doc.createTextNode( *crsIt );
crsElem.appendChild( crsText );
layerParentElem.appendChild( crsElem );
}
QStringList crsList = createCRSListForLayer( 0 );
appendCRSElementsToLayer( layerParentElem, doc, crsList );

//Map rectangle. If not empty, this will be set for every layer (instead of the bbox that comes from the data)
QgsRectangle mapExtent = mapRectangle();
Expand Down

0 comments on commit 3ab4c13

Please sign in to comment.