fixed extension stuff for rscollection

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4666 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-11-09 14:16:19 +00:00
parent f77bb8136f
commit 072c6c7e12
3 changed files with 8 additions and 5 deletions

View File

@ -916,11 +916,14 @@ void RetroshareDirModel::createCollectionFile(const QModelIndexList &list)
return ; return ;
} }
QString filename = QFileDialog::getSaveFileName(NULL,tr("Create selection file"),".",tr("Collection files")+" (*.rscollection)") ; QString filename ;
if(filename.isNull()) if(!misc::getSaveFileName(NULL,RshareSettings::LASTDIR_EXTRAFILE,tr("Create selection file"),tr("Collection files")+" (*."+RsCollectionFile::ExtensionString+")",filename))
return ; return ;
if(!filename.endsWith("."+RsCollectionFile::ExtensionString))
filename += "."+RsCollectionFile::ExtensionString ;
std::cerr << "Got file name: "<< filename.toStdString() << std::endl; std::cerr << "Got file name: "<< filename.toStdString() << std::endl;
std::vector <DirDetails> dirVec; std::vector <DirDetails> dirVec;
getDirDetailsFromSelect(list, dirVec); getDirDetailsFromSelect(list, dirVec);

View File

@ -34,7 +34,7 @@
#include <QDomElement> #include <QDomElement>
#include <QDomDocument> #include <QDomDocument>
const QString RsCollectionFile::ExtensionString = QString(".rscollection") ; const QString RsCollectionFile::ExtensionString = QString("rscollection") ;
RsCollectionFile::RsCollectionFile(const QString& filename) RsCollectionFile::RsCollectionFile(const QString& filename)
: _xml_doc("RsCollection") : _xml_doc("RsCollection")

View File

@ -28,7 +28,7 @@
bool RsUrlHandler::openUrl(const QUrl& url) 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 try
{ {