Skip to content

Commit

Permalink
applied patch to show GDAL version in about dialog, to fix #2804
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@13725 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
brushtyler committed Jun 13, 2010
1 parent 27e451c commit a87414c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
18 changes: 6 additions & 12 deletions python/plugins/GdalTools/tools/GdalTools_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,33 +603,27 @@ def filename2ShortName(self, fileName):
# class which allows to create version objects and compare them
class Version:
def __init__(self, ver):
self.vers = (0, 0, 0)
self.vers = ('0', '0', '0')

if isinstance(ver, Version):
self.vers = ver.vers
elif isinstance(ver, tuple) or isinstance(ver, list):
self.vers = tuple(ver)
self.vers = map(str, ver)
elif isinstance(ver, str) or isinstance(ver, QString):
self.vers = self.string2vers(ver)

@staticmethod
def string2vers(string):
vers = [0, 0, 0]
vers = ['0', '0', '0']

nums = str(string).split(".")

if len(nums) > 0:
n = QString(nums[0]).remove( QRegExp( "[^0-9].*$" ) )
if not n.isEmpty():
vers[0] = int(n)
vers[0] = nums[0]
if len(nums) > 1:
n = QString(nums[1]).remove( QRegExp( "[^0-9].*$" ) )
if not n.isEmpty():
vers[1] = int(n)
vers[1] = nums[1]
if len(nums) > 2:
n = QString(nums[2]).remove( QRegExp( "[^0-9].*$" ) )
if not n.isEmpty():
vers[2] = int(n)
vers[2] = nums[2]

return (vers[0], vers[1], vers[2])

Expand Down
3 changes: 2 additions & 1 deletion python/plugins/GdalTools/tools/doAbout.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from ui_dialogAbout import Ui_GdalToolsAboutDialog as Ui_Dialog
from GdalTools import version
from GdalTools_utils import GdalConfig

class GdalToolsAboutDialog(QDialog, Ui_Dialog):

Expand All @@ -17,7 +18,7 @@ def __init__(self, iface):

QObject.connect(self.btnWeb, SIGNAL("clicked()"), self.openWebsite)

self.lblVersion.setText( version() )
self.lblVersion.setText( version() + self.tr( "\n(using GDAL v. %1)" ).arg( str( GdalConfig.version() ) ) )
self.textEdit.setText(self.getText())

def getText(self):
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2390,6 +2390,9 @@ void QgisApp::about()
QString versionString = tr( "You are using QGIS version %1 built against code revision %2." )
.arg( QGis::QGIS_VERSION )
.arg( QGis::QGIS_SVN_VERSION );

versionString += tr( "\nThis copy of QGIS has been built with GDAL/OGR %1." ).arg( GDAL_RELEASE_NAME );

#ifdef HAVE_POSTGRESQL
versionString += tr( "\nThis copy of QGIS has been built with PostgreSQL support (%1)." ).arg( PG_VERSION );
#else
Expand Down

0 comments on commit a87414c

Please sign in to comment.