Diffstat (limited to 'core/apps/textedit/fileSaver.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/textedit/fileSaver.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/core/apps/textedit/fileSaver.cpp b/core/apps/textedit/fileSaver.cpp index 88608cc..af51fc3 100644 --- a/core/apps/textedit/fileSaver.cpp +++ b/core/apps/textedit/fileSaver.cpp @@ -49,9 +49,9 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl ListView->setAllColumnsShowFocus( TRUE ); ListView->setGeometry( QRect( 10, 35, 220, 160 ) ); fileEdit= new QLineEdit(this); - fileEdit->setGeometry( QRect( 10, 230, 200, 25)); + fileEdit->setGeometry( QRect( 10, 200, 200, 22)); fileEdit->setText( tmpFileName); // signals and slots connections @@ -146,9 +146,9 @@ void fileSaver::listClicked(QListViewItem *selectedItem) if(QDir(strItem).exists()){ currentDir.cd(strItem, TRUE); populateList(); } - } // else + } // else // if( QFile::exists(strItem ) ) { // qDebug("We found our files!!"); // OnOK(); @@ -158,15 +158,25 @@ void fileSaver::listClicked(QListViewItem *selectedItem) } -void fileSaver::OnOK() +void fileSaver::closeEvent( QCloseEvent *e ) { -// reject(); + if(e->isAccepted()) { + e->accept(); + } else { + qDebug("not accepted"); + done(-1); + } } void fileSaver::accept() { selectedFileName = fileEdit->text(); - selectedFileName = currentDir.canonicalPath()+ selectedFileName; - qDebug("goint to save "+selectedFileName); - reject(); + QString path = currentDir.canonicalPath()+"/" + selectedFileName; + if( path.find("//",0,TRUE) ==-1 ) { + selectedFileName = path; + } else { + selectedFileName = currentDir.canonicalPath()+selectedFileName; + } + qDebug("going to save "+selectedFileName); + done(1); } |