Skip to content

Commit 3ab4c13

Browse files
committed
Merge branch 'master' of github.com:qgis/Quantum-GIS
2 parents 89ddd03 + 7acce88 commit 3ab4c13

File tree

4 files changed

+42
-11
lines changed

4 files changed

+42
-11
lines changed

src/app/qgsconfigureshortcutsdialog.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,33 @@ QgsConfigureShortcutsDialog::QgsConfigureShortcutsDialog( QWidget* parent )
4343
this, SLOT( actionChanged( QTreeWidgetItem*, QTreeWidgetItem* ) ) );
4444

4545
populateActions();
46+
47+
restoreState();
4648
}
4749

50+
QgsConfigureShortcutsDialog::~QgsConfigureShortcutsDialog()
51+
{
52+
saveState();
53+
}
54+
55+
/*!
56+
* Function to save dialog window state
57+
*/
58+
void QgsConfigureShortcutsDialog::saveState()
59+
{
60+
QSettings settings;
61+
settings.setValue( "/Windows/ShortcutsDialog/geometry", saveGeometry() );
62+
}
63+
64+
/*!
65+
* Function to restore dialog window state
66+
*/
67+
void QgsConfigureShortcutsDialog::restoreState()
68+
{
69+
QSettings settings;
70+
restoreGeometry( settings.value( "/Windows/ShortcutsDialog/geometry" ).toByteArray() );
71+
}
72+
4873
void QgsConfigureShortcutsDialog::populateActions()
4974
{
5075
QList<QAction*> actions = QgsShortcutsManager::instance()->listActions();

src/app/qgsconfigureshortcutsdialog.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsConfigureShor
2626

2727
public:
2828
QgsConfigureShortcutsDialog( QWidget* parent = NULL );
29-
29+
~QgsConfigureShortcutsDialog();
30+
3031
void populateActions();
3132

3233
protected:
@@ -51,6 +52,18 @@ class QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsConfigureShor
5152
protected:
5253
bool mGettingShortcut;
5354
int mModifiers, mKey;
55+
56+
private:
57+
/*!
58+
* Function to save dialog window state
59+
*/
60+
void saveState();
61+
62+
/*!
63+
* Function to restore dialog window state
64+
*/
65+
void restoreState();
66+
5467
};
5568

5669
#endif

src/mapserver/qgsconfigparser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ QStringList QgsConfigParser::createCRSListForLayer( QgsMapLayer* theMapLayer ) c
140140

141141
//check the db is available
142142
myResult = sqlite3_open( myDatabaseFileName.toLocal8Bit().data(), &myDatabase );
143-
if ( myResult )
143+
if ( myResult && theMapLayer )
144144
{
145145
//if the database cannot be opened, add at least the epsg number of the source coordinate system
146146
crsNumbers.push_back( theMapLayer->crs().authid() );

src/mapserver/qgsprojectparser.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,8 @@ void QgsProjectParser::layersAndStylesCapabilities( QDomElement& parentElement,
102102
layerParentTitleElem.appendChild( layerParentTitleText );
103103
layerParentElem.appendChild( layerParentTitleElem );
104104

105-
QSet<QString> crsSet = supportedOutputCrsSet();
106-
QSet<QString>::const_iterator crsIt = crsSet.constBegin();
107-
for(; crsIt != crsSet.constEnd(); ++crsIt )
108-
{
109-
QDomElement crsElem = doc.createElement("CRS");
110-
QDomText crsText = doc.createTextNode( *crsIt );
111-
crsElem.appendChild( crsText );
112-
layerParentElem.appendChild( crsElem );
113-
}
105+
QStringList crsList = createCRSListForLayer( 0 );
106+
appendCRSElementsToLayer( layerParentElem, doc, crsList );
114107

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

0 commit comments

Comments
 (0)