From 072c6c7e12dc11733f82ef5a29c5086adc0b9db5 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 9 Nov 2011 14:16:19 +0000 Subject: [PATCH] fixed extension stuff for rscollection git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4666 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/RemoteDirModel.cpp | 9 ++++++--- retroshare-gui/src/gui/common/RsCollectionFile.cpp | 2 +- retroshare-gui/src/gui/common/RsUrlHandler.cpp | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/RemoteDirModel.cpp b/retroshare-gui/src/gui/RemoteDirModel.cpp index 3a7dd2b06..78a40f7e7 100644 --- a/retroshare-gui/src/gui/RemoteDirModel.cpp +++ b/retroshare-gui/src/gui/RemoteDirModel.cpp @@ -916,11 +916,14 @@ void RetroshareDirModel::createCollectionFile(const QModelIndexList &list) return ; } - QString filename = QFileDialog::getSaveFileName(NULL,tr("Create selection file"),".",tr("Collection files")+" (*.rscollection)") ; - - if(filename.isNull()) + QString filename ; + + if(!misc::getSaveFileName(NULL,RshareSettings::LASTDIR_EXTRAFILE,tr("Create selection file"),tr("Collection files")+" (*."+RsCollectionFile::ExtensionString+")",filename)) return ; + if(!filename.endsWith("."+RsCollectionFile::ExtensionString)) + filename += "."+RsCollectionFile::ExtensionString ; + std::cerr << "Got file name: "<< filename.toStdString() << std::endl; std::vector dirVec; getDirDetailsFromSelect(list, dirVec); diff --git a/retroshare-gui/src/gui/common/RsCollectionFile.cpp b/retroshare-gui/src/gui/common/RsCollectionFile.cpp index 6603d1d68..ff5a6aef2 100644 --- a/retroshare-gui/src/gui/common/RsCollectionFile.cpp +++ b/retroshare-gui/src/gui/common/RsCollectionFile.cpp @@ -34,7 +34,7 @@ #include #include -const QString RsCollectionFile::ExtensionString = QString(".rscollection") ; +const QString RsCollectionFile::ExtensionString = QString("rscollection") ; RsCollectionFile::RsCollectionFile(const QString& filename) : _xml_doc("RsCollection") diff --git a/retroshare-gui/src/gui/common/RsUrlHandler.cpp b/retroshare-gui/src/gui/common/RsUrlHandler.cpp index e0019f952..2ed1c6b57 100644 --- a/retroshare-gui/src/gui/common/RsUrlHandler.cpp +++ b/retroshare-gui/src/gui/common/RsUrlHandler.cpp @@ -28,7 +28,7 @@ bool RsUrlHandler::openUrl(const QUrl& url) { - if(url.scheme() == QString("file") && url.toLocalFile().endsWith(RsCollectionFile::ExtensionString)) + if(url.scheme() == QString("file") && url.toLocalFile().endsWith("."+RsCollectionFile::ExtensionString)) { try {