Hi, <br><br> Thanks for the review.<br><br>New patch file<i><br>Index: trunk/marble/src/QtMainWindow.cpp<br>===================================================================<br>--- trunk/marble/src/QtMainWindow.cpp (revision 9)<br>
+++ trunk/marble/src/QtMainWindow.cpp (revision 10)<br>@@ -668,7 +668,8 @@<br> <br> QDir dirObj;<br> <br>- currentDir = dirObj.absoluteFilePath( fileNames.at( fileNames.size() -1));<br>+ if(fileNames.size()!=0)<br>
+ currentDir = dirObj.absoluteFilePath( fileNames.at( fileNames.size() -1));<br> <br> foreach( const QString &fileName, fileNames ) {<br> QString extension = fileName.section( '.', -1 );</i><br clear="all">
<br>Thanks & Regards,<br>Prashant Bhutani<br>
<br><br><div class="gmail_quote">On Tue, Oct 5, 2010 at 11:34 AM, Dennis Nienhüser <span dir="ltr"><<a href="mailto:earthwings@gentoo.org">earthwings@gentoo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
thanks for the patch, looks pretty good. Did you try what happens when you<br>
cancel the dialog? I think this would result in a crash right now since you<br>
don't check whether the stringlist is empty. Can you verify that and change<br>
the patch accordingly?<br>
<br>
Regards,<br>
Dennis<br>
<br>
Am Dienstag, 5. Oktober 2010, um 06:50:08 schrieb prashant bhutani:<br>
<div><div></div><div class="h5">> Hi all,<br>
><br>
> For Qt version of the Junior Job[1] , I am attaching the patch file (as<br>
> well as code[2] in this mail).<br>
> I have tested it. It is working and remembering the directory last opened.<br>
> Please review it and do tell me if I am wrong.<br>
><br>
> Thanks & Regards,<br>
> Prashant Bhutani<br>
><br>
> [1]<br>
> <a href="http://techbase.kde.org/Projects/Marble/GoMarble/JJ#Let_the_.22Open_....22_" target="_blank">http://techbase.kde.org/Projects/Marble/GoMarble/JJ#Let_the_.22Open_....22_</a><br>
> file_dialog_remember_the_previously_used_directory<br>
><br>
> [2] Here is the patch data ::<br>
> *Index: trunk/marble/src/QtMainWindow.cpp<br>
> ===================================================================<br>
> --- trunk/marble/src/QtMainWindow.cpp (revision 8)<br>
> +++ trunk/marble/src/QtMainWindow.cpp (revision 9)<br>
> @@ -661,10 +661,15 @@<br>
><br>
> void MainWindow::openFile()<br>
> {<br>
> + static QString currentDir = QString();<br>
> QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Open<br>
> File"),<br>
> - QString(),<br>
> + currentDir,<br>
> tr("All Supported Files (*.gpx *.kml);;GPS<br>
> Data (*.gpx);;Google Earth KML (*.kml)"));<br>
><br>
> + QDir dirObj;<br>
> +<br>
> + currentDir = dirObj.absoluteFilePath( fileNames.at( fileNames.size()<br>
> -1);<br>
> +<br>
> foreach( const QString &fileName, fileNames ) {<br>
</div></div>> QString extension = fileName.section( '.', -1 );*<br>
<br>
_______________________________________________<br>
Marble-devel mailing list<br>
<a href="mailto:Marble-devel@kde.org">Marble-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/marble-devel" target="_blank">https://mail.kde.org/mailman/listinfo/marble-devel</a><br>
</blockquote></div><br>