summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/tinykate.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/tinykate/tinykate.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/tinykate/tinykate.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/noncore/apps/tinykate/tinykate.cpp b/noncore/apps/tinykate/tinykate.cpp
index c8c3b31..51afd31 100644
--- a/noncore/apps/tinykate/tinykate.cpp
+++ b/noncore/apps/tinykate/tinykate.cpp
@@ -141,50 +141,53 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
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()) {
open(filename);
}
}
void TinyKate::open(const QString & filename)
{
KateDocument *kd= new KateDocument(false, false, this,0,this);
KTextEditor::View *kv;
QFileInfo fi(filename);
- tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate",fi.fileName());
+ QString filenamed = fi.fileName();
+ tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed );
qDebug(filename);
+
+ kd->setDocName( filenamed);
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()));
}
currentView=(KTextEditor::View*)view;
connect(editCopy,SIGNAL(activated()),currentView,SLOT(copy()));
connect(editCut,SIGNAL(activated()),currentView,SLOT(cut()));
connect(editPaste,SIGNAL(activated()),currentView,SLOT(paste()));