[Marble-devel] Re: Junior Job Patch for Review

prashant bhutani prashantbhutani2008 at gmail.com
Tue Oct 5 08:15:04 CEST 2010


Hi,

 Thanks for the review.

New patch file*
Index: trunk/marble/src/QtMainWindow.cpp
===================================================================
--- trunk/marble/src/QtMainWindow.cpp    (revision 9)
+++ trunk/marble/src/QtMainWindow.cpp    (revision 10)
@@ -668,7 +668,8 @@

     QDir dirObj;

-    currentDir = dirObj.absoluteFilePath( fileNames.at( fileNames.size()
-1));
+    if(fileNames.size()!=0)
+    currentDir = dirObj.absoluteFilePath( fileNames.at( fileNames.size()
-1));

     foreach( const QString &fileName, fileNames ) {
         QString extension = fileName.section( '.', -1 );*

Thanks & Regards,
Prashant Bhutani


On Tue, Oct 5, 2010 at 11:34 AM, Dennis Nienhüser <earthwings at gentoo.org>wrote:

> Hi,
>
> thanks for the patch, looks pretty good. Did you try what happens when you
> cancel the dialog? I think this would result in a crash right now since you
> don't check whether the stringlist is empty. Can you verify that and change
> the patch accordingly?
>
> Regards,
> Dennis
>
> Am Dienstag, 5. Oktober 2010, um 06:50:08 schrieb prashant bhutani:
> > Hi all,
> >
> > For Qt version of the Junior Job[1] , I am attaching the patch file (as
> > well as code[2] in this mail).
> > I have tested it. It is working and remembering the directory last
> opened.
> > Please review it and do tell me if I am wrong.
> >
> > Thanks & Regards,
> > Prashant Bhutani
> >
> > [1]
> >
> http://techbase.kde.org/Projects/Marble/GoMarble/JJ#Let_the_.22Open_....22_
> > file_dialog_remember_the_previously_used_directory
> >
> > [2] Here is the patch data ::
> > *Index: trunk/marble/src/QtMainWindow.cpp
> > ===================================================================
> > --- trunk/marble/src/QtMainWindow.cpp    (revision 8)
> > +++ trunk/marble/src/QtMainWindow.cpp    (revision 9)
> > @@ -661,10 +661,15 @@
> >
> >  void MainWindow::openFile()
> >  {
> > +    static QString currentDir = QString();
> >      QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Open
> > File"),
> > -                            QString(),
> > +                            currentDir,
> >                              tr("All Supported Files (*.gpx *.kml);;GPS
> > Data (*.gpx);;Google Earth KML (*.kml)"));
> >
> > +    QDir dirObj;
> > +
> > +    currentDir = dirObj.absoluteFilePath( fileNames.at( fileNames.size()
> > -1);
> > +
> >      foreach( const QString &fileName, fileNames ) {
> >          QString extension = fileName.section( '.', -1 );*
>
> _______________________________________________
> Marble-devel mailing list
> Marble-devel at kde.org
> https://mail.kde.org/mailman/listinfo/marble-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/marble-devel/attachments/20101005/8b350adc/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: data.patch
Type: application/octet-stream
Size: 555 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/marble-devel/attachments/20101005/8b350adc/attachment.dll 


More information about the Marble-devel mailing list