[Marble-commits] KDE/kdeedu/marble/src

Dennis Nienhüser earthwings at gentoo.org
Fri Apr 23 22:21:31 CEST 2010


SVN commit 1118077 by nienhueser:

Support opening multiple files at once.
CCBUG: 163132

 M  +1 -2      QtMainWindow.cpp  
 M  +2 -3      marble_part.cpp  


--- trunk/KDE/kdeedu/marble/src/QtMainWindow.cpp #1118076:1118077
@@ -643,8 +643,7 @@
                             tr("All Supported Files (*.gpx *.kml);;GPS Data (*.gpx);;Google Earth KML (*.kml)"));
 
     foreach( const QString &fileName, fileNames ) {
-        QFileInfo fileInfo(fileName);
-        QString extension = fileInfo.suffix();
+        QString extension = fileName.section( '.', -1 );
 
         if ( extension.compare( "gpx", Qt::CaseInsensitive ) == 0 ) {
             m_controlView->marbleWidget()->openGpxFile( fileName );
--- trunk/KDE/kdeedu/marble/src/marble_part.cpp #1118076:1118077
@@ -169,12 +169,11 @@
 
 bool MarblePart::openFile()
 {
-    QString fileName;
-    fileName = KFileDialog::getOpenFileName( KUrl(),
+    QStringList fileNames = KFileDialog::getOpenFileNames( KUrl(),
                                     i18n("*.gpx *.kml|All Supported Files\n*.gpx|GPS Data\n*.kml|Google Earth KML"),
                                             widget(), i18n("Open File")
                                            );
-    if ( ! fileName.isNull() ) {
+    foreach( const QString &fileName, fileNames ) {
         QString extension = fileName.section( '.', -1 );
 
         if ( extension.compare( "gpx", Qt::CaseInsensitive ) == 0 ) {


More information about the Marble-commits mailing list