Commit 47fe02c1 authored by Marlin Frickenschmidt's avatar Marlin Frickenschmidt

fix bug #341

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10682 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d01d2c60
......@@ -261,7 +261,7 @@ void Core::saveAllObjects(){
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS) ;
o_it != PluginFunctions::objectsEnd(); ++o_it) {
if ( !QDir(o_it->path()).exists() || o_it->path().trimmed() == "" ) // if path isn't valid use 'save object to'
if ( !QDir(o_it->path()).exists() || o_it->path().trimmed() == "" || o_it->path().trimmed() == "." ) // if path isn't valid use 'save object to'
saveObjectTo(o_it->id(),o_it->name());
else{
//save (existing files will be overwritten)
......
......@@ -260,7 +260,7 @@ void LoadWidget::saveFile(){
QStringList files = selectedFiles();
if ( files.size() != 1 ) {
std::cerr << "Error no or multiple save files selected" << std::endl;
std::cerr << "Error: zero or multiple save files selected!" << std::endl;
return;
}
......@@ -339,9 +339,6 @@ int LoadWidget::showLoad(){
/// show Widget for saving Files
int LoadWidget::showSave(int _id, QString _filename){
std::cerr << "save single file" << std::endl;
setAcceptMode ( QFileDialog::AcceptSave );
setFileMode( QFileDialog::AnyFile );
setWindowTitle(tr("Save Object"));
......@@ -373,16 +370,8 @@ int LoadWidget::showSave(int _id, QString _filename){
QFileInfo fi(_filename);
QFile file(_filename);
if (file.exists()) {
setDirectory( fi.absolutePath() );
selectFile ( fi.fileName() );
} else {
// setDirectory(OpenFlipper::Options::currentDir().absolutePath() );
std::cout << "setting filename = " << _filename.toStdString() << std::endl;
setDirectory( fi.absolutePath() );
setDirectory(OpenFlipperSettings().value("Core/CurrentDir").toString() );
selectFile ( fi.fileName() );
}
//try to select the best fitting name filter
for (int i=0; i < nameFilters().count(); i++){
......@@ -404,9 +393,6 @@ int LoadWidget::showSave(int _id, QString _filename){
/// show Widget for saving Files
int LoadWidget::showSave(IdList _ids, QString _filename){
std::cerr << "save multiple files" << std::endl;
setAcceptMode ( QFileDialog::AcceptSave );
setFileMode( QFileDialog::AnyFile );
setWindowTitle(tr("Save Objects"));
......@@ -443,16 +429,8 @@ int LoadWidget::showSave(IdList _ids, QString _filename){
QFileInfo fi(_filename);
QFile file(_filename);
if (file.exists()) {
setDirectory( fi.absolutePath() );
selectFile ( fi.fileName() );
} else {
// setDirectory(OpenFlipper::Options::currentDir().absolutePath() );
std::cout << "setting filename = " << _filename.toStdString() << std::endl;
setDirectory( fi.absolutePath() );
setDirectory(OpenFlipperSettings().value("Core/CurrentDir").toString() );
selectFile ( fi.fileName() );
}
//try to select the best fitting name filter
for (int i=0; i < nameFilters().count(); i++){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment