summaryrefslogtreecommitdiff
path: root/core
Side-by-side diff
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/textedit/fileSaver.cpp3
-rw-r--r--core/apps/textedit/textedit.cpp16
2 files changed, 13 insertions, 6 deletions
diff --git a/core/apps/textedit/fileSaver.cpp b/core/apps/textedit/fileSaver.cpp
index b1ddc0b..209a258 100644
--- a/core/apps/textedit/fileSaver.cpp
+++ b/core/apps/textedit/fileSaver.cpp
@@ -177,12 +177,13 @@ void fileSaver::upDir()
void fileSaver::listDoubleClicked(QListViewItem *selectedItem)
{
}
void fileSaver::listClicked(QListViewItem *selectedItem)
{
+ if(selectedItem != NULL) {
QString strItem=selectedItem->text(0);
QString strSize=selectedItem->text(1);
// qDebug("strItem is "+strItem);
strSize.stripWhiteSpace();
// qDebug(strSize);
@@ -213,13 +214,13 @@ void fileSaver::listClicked(QListViewItem *selectedItem)
// qDebug("We found our files!!");
// OnOK();
} //end not symlink
chdir(strItem.latin1());
-
+ }
}
void fileSaver::closeEvent( QCloseEvent *e )
{
if(e->isAccepted()) {
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index f89ed6d..f99f259 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -507,13 +507,13 @@ void TextEdit::fileOpen()
Config cfg("TextEdit");
cfg.setGroup("View");
bool b=FALSE;
// if(cfg.readEntry("useOldFileDialog") == "TRUE")
// b=TRUE;
// if(!b) {
- QString str = OFileDialog::getOpenFileName( 1,"/");//,"", "*", this );
+ QString str = OFileDialog::getOpenFileName( 2,"/");//,"", "*", this );
if(!str.isEmpty() )
openFile( str );
// } else {
// QString str;
// browseForFiles = new fileBrowser(this,tr("Open File"),TRUE,0, "*"); //
// browseForFiles->setFileView( viewSelection );
@@ -745,12 +745,13 @@ bool TextEdit::save()
qDebug("saveFile "+currentFileName);
struct stat buf;
mode_t mode;
stat(file.latin1(), &buf);
mode = buf.st_mode;
+
if(!fileIs) {
doc->setName( name);
FileManager fm;
if ( !fm.saveFile( *doc, rt ) ) {
return false;
}
@@ -819,17 +820,22 @@ bool TextEdit::saveAs()
doc->setName(docname);
currentFileName=docname;
}
}
- fileSaveDlg=new fileSaver(this,tr("Save File As?"),TRUE, 0, currentFileName);
- qDebug("wanna save filename "+currentFileName);
- fileSaveDlg->exec();
- if( fileSaveDlg->result() == 1 ) {
+// QString str = OFileDialog::getSaveFileName( 2,"/");//,"", "*", this );
+// if(!str.isEmpty() ) {
+// openFile( str );
+
+ fileSaveDlg=new fileSaver(this,tr("Save File As?"),TRUE, 0, currentFileName);
+ qDebug("wanna save filename "+currentFileName);
+ fileSaveDlg->exec();
+ if( fileSaveDlg->result() == 1 ) {
QString fileNm=fileSaveDlg->selectedFileName;
+// QString fileNm=srt;
qDebug("saving filename "+fileNm);
QFileInfo fi(fileNm);
currentFileName=fi.fileName();
if(doc) {
// QString file = doc->file();
// doc->removeFiles();