Diffstat (limited to 'core/apps/textedit/fileSaver.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/textedit/fileSaver.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/core/apps/textedit/fileSaver.cpp b/core/apps/textedit/fileSaver.cpp index d01daee..88608cc 100644 --- a/core/apps/textedit/fileSaver.cpp +++ b/core/apps/textedit/fileSaver.cpp | |||
@@ -26,13 +26,15 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl | |||
26 | : QDialog( parent, name, modal, fl ) | 26 | : QDialog( parent, name, modal, fl ) |
27 | { | 27 | { |
28 | if ( !name ) | 28 | if ( !name ) |
29 | setName( "fileSaver" ); | 29 | setName( "fileSaver" ); |
30 | resize( 236, 280 ); | 30 | resize( 236, 280 ); |
31 | setCaption(tr( "Save file" ) ); | 31 | setCaption(tr( "Save file" ) ); |
32 | // filterStr=currentFileName; | 32 | QFileInfo fi(currentFileName); |
33 | QString tmpFileName=fi.fileName(); | ||
34 | // qDebug( tmpFileName); | ||
33 | 35 | ||
34 | dirLabel = new QLabel(this, "DirLabel"); | 36 | dirLabel = new QLabel(this, "DirLabel"); |
35 | dirLabel->setText(currentDir.canonicalPath()); | 37 | dirLabel->setText(currentDir.canonicalPath()); |
36 | dirLabel->setGeometry(10,4,230,30); | 38 | dirLabel->setGeometry(10,4,230,30); |
37 | 39 | ||
38 | ListView = new QListView( this, "ListView" ); | 40 | ListView = new QListView( this, "ListView" ); |
@@ -46,17 +48,22 @@ fileSaver::fileSaver( QWidget* parent, const char* name, bool modal, WFlags fl | |||
46 | 48 | ||
47 | ListView->setAllColumnsShowFocus( TRUE ); | 49 | ListView->setAllColumnsShowFocus( TRUE ); |
48 | ListView->setGeometry( QRect( 10, 35, 220, 160 ) ); | 50 | ListView->setGeometry( QRect( 10, 35, 220, 160 ) ); |
49 | 51 | ||
50 | fileEdit= new QLineEdit(this); | 52 | fileEdit= new QLineEdit(this); |
51 | fileEdit->setGeometry( QRect( 10, 230, 200, 25)); | 53 | fileEdit->setGeometry( QRect( 10, 230, 200, 25)); |
52 | fileEdit->setText(currentFileName); | 54 | |
53 | // signals and slots connections | 55 | fileEdit->setText( tmpFileName); |
56 | |||
57 | // signals and slots connections | ||
54 | connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); | 58 | connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); |
55 | connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); | 59 | connect( ListView, SIGNAL(pressed( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); |
56 | currentDir.setPath(QDir::currentDirPath() ); | 60 | |
61 | // tmpFileName=fi.FilePath(); | ||
62 | // qDebug( tmpFileName); | ||
63 | currentDir.setPath( QDir::currentDirPath() ); | ||
57 | populateList(); | 64 | populateList(); |
58 | } | 65 | } |
59 | 66 | ||
60 | fileSaver::~fileSaver() | 67 | fileSaver::~fileSaver() |
61 | { | 68 | { |
62 | } | 69 | } |
@@ -157,8 +164,9 @@ void fileSaver::OnOK() | |||
157 | // reject(); | 164 | // reject(); |
158 | } | 165 | } |
159 | 166 | ||
160 | void fileSaver::accept() { | 167 | void fileSaver::accept() { |
161 | selectedFileName = fileEdit->text(); | 168 | selectedFileName = fileEdit->text(); |
162 | selectedFileName = currentDir.canonicalPath()+ selectedFileName; | 169 | selectedFileName = currentDir.canonicalPath()+ selectedFileName; |
170 | qDebug("goint to save "+selectedFileName); | ||
163 | reject(); | 171 | reject(); |
164 | } | 172 | } |