author | llornkcor <llornkcor> | 2002-12-26 04:27:24 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-12-26 04:27:24 (UTC) |
commit | ec49b87e16b1a198847bd2511ebdccb5fdd3b2c5 (patch) (side-by-side diff) | |
tree | 8708fc4a5374b8e3b95b40323c80b88bfe46846f | |
parent | df79efd854ebb22046e98b9076d31e94e2245ab2 (diff) | |
download | opie-ec49b87e16b1a198847bd2511ebdccb5fdd3b2c5.zip opie-ec49b87e16b1a198847bd2511ebdccb5fdd3b2c5.tar.gz opie-ec49b87e16b1a198847bd2511ebdccb5fdd3b2c5.tar.bz2 |
small fix for setting the directory in getOpenFileName, so it will return the fullpath
-rw-r--r-- | noncore/apps/tinykate/tinykate.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/noncore/apps/tinykate/tinykate.cpp b/noncore/apps/tinykate/tinykate.cpp index 51afd31..6164fa5 100644 --- a/noncore/apps/tinykate/tinykate.cpp +++ b/noncore/apps/tinykate/tinykate.cpp @@ -138,49 +138,50 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : hlmenu->insertItem(hlm->hlName(i),i); } popup->insertItem(tr("Highlighting"),hlmenu); utilSettings = new QAction( tr( "Settings" ), QString::null, 0, this, 0 ); utilSettings->addTo( popup); if( qApp->argc() > 1) open(qApp->argv()[1]); else slotNew(); } void TinyKate::slotOpen( ) { - QString filename=OFileDialog::getOpenFileName(OFileSelector::EXTENDED_ALL); - if (!filename.isEmpty()) { + QString filename = OFileDialog::getOpenFileName( OFileSelector::EXTENDED_ALL, + QPEApplication::documentDir()); + if (!filename.isEmpty()) { open(filename); } } void TinyKate::open(const QString & filename) { KateDocument *kd= new KateDocument(false, false, this,0,this); KTextEditor::View *kv; QFileInfo fi(filename); QString filenamed = fi.fileName(); tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed ); qDebug(filename); kd->setDocName( filenamed); - kd->open(filename); + kd->open( filename ); viewCount++; } void TinyKate::slotCurrentChanged( QWidget * view) { if (currentView) { disconnect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); disconnect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); disconnect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); disconnect(editUndo,SIGNAL(activated()),currentView,SLOT(undo())); disconnect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); disconnect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); @@ -227,30 +228,31 @@ void TinyKate::slotSave() { // KateView *kv = (KateView*) currentView; KateDocument *kd = (KateDocument*) currentView->document(); // qDebug("saving file "+kd->docName()); if( kd->docName().isEmpty()) slotSaveAs(); else kd->saveFile(); // kv->save(); // kd->saveFile(); } void TinyKate::slotSaveAs() { if (currentView==0) return; KateDocument *kd = (KateDocument*) currentView->document(); - QString filename=OFileDialog::getSaveFileName(OFileSelector::EXTENDED_ALL); + QString filename=OFileDialog::getSaveFileName(OFileSelector::EXTENDED_ALL, + QPEApplication::documentDir()); if (!filename.isEmpty()) { qDebug("saving file "+filename); QFileInfo fi(filename); QString filenamed = fi.fileName(); kd->setDocFile( filename); kd->setDocName( filenamed); kd->saveFile(); // KTextEditor::View *dv = currentView; // tabwidget->changeTab( dv, filenamed); // need to change tab label here } } |