-rw-r--r-- | noncore/apps/tinykate/tinykate.cpp | 5 |
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) : | |||
141 | 141 | ||
142 | 142 | ||
143 | utilSettings = new QAction( tr( "Settings" ), QString::null, 0, this, 0 ); | 143 | utilSettings = new QAction( tr( "Settings" ), QString::null, 0, this, 0 ); |
144 | utilSettings->addTo( popup); | 144 | utilSettings->addTo( popup); |
145 | 145 | ||
146 | if( qApp->argc() > 1) open(qApp->argv()[1]); | 146 | if( qApp->argc() > 1) open(qApp->argv()[1]); |
147 | else slotNew(); | 147 | else slotNew(); |
148 | 148 | ||
149 | } | 149 | } |
150 | 150 | ||
151 | 151 | ||
152 | void TinyKate::slotOpen( ) | 152 | void TinyKate::slotOpen( ) |
153 | { | 153 | { |
154 | QString filename=OFileDialog::getOpenFileName(OFileSelector::EXTENDED_ALL); | 154 | QString filename=OFileDialog::getOpenFileName(OFileSelector::EXTENDED_ALL); |
155 | if (!filename.isEmpty()) { | 155 | if (!filename.isEmpty()) { |
156 | open(filename); | 156 | open(filename); |
157 | } | 157 | } |
158 | } | 158 | } |
159 | 159 | ||
160 | void TinyKate::open(const QString & filename) | 160 | void TinyKate::open(const QString & filename) |
161 | { | 161 | { |
162 | KateDocument *kd= new KateDocument(false, false, this,0,this); | 162 | KateDocument *kd= new KateDocument(false, false, this,0,this); |
163 | KTextEditor::View *kv; | 163 | KTextEditor::View *kv; |
164 | QFileInfo fi(filename); | 164 | QFileInfo fi(filename); |
165 | tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate",fi.fileName()); | 165 | QString filenamed = fi.fileName(); |
166 | tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed ); | ||
166 | qDebug(filename); | 167 | qDebug(filename); |
168 | |||
169 | kd->setDocName( filenamed); | ||
167 | kd->open(filename); | 170 | kd->open(filename); |
168 | viewCount++; | 171 | viewCount++; |
169 | } | 172 | } |
170 | 173 | ||
171 | void TinyKate::slotCurrentChanged( QWidget * view) | 174 | void TinyKate::slotCurrentChanged( QWidget * view) |
172 | { | 175 | { |
173 | if (currentView) { | 176 | if (currentView) { |
174 | 177 | ||
175 | disconnect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); | 178 | disconnect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); |
176 | disconnect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); | 179 | disconnect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); |
177 | disconnect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); | 180 | disconnect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); |
178 | disconnect(editUndo,SIGNAL(activated()),currentView,SLOT(undo())); | 181 | disconnect(editUndo,SIGNAL(activated()),currentView,SLOT(undo())); |
179 | disconnect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); | 182 | disconnect(editRedo,SIGNAL(activated()),currentView,SLOT(redo())); |
180 | disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); | 183 | disconnect(viewIncFontSizes,SIGNAL(activated()), currentView,SLOT(slotIncFontSizes())); |
181 | disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); | 184 | disconnect(viewDecFontSizes,SIGNAL(activated()), currentView,SLOT(slotDecFontSizes())); |
182 | disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); | 185 | disconnect(hlmenu,SIGNAL(activated(int)), currentView,SLOT(setHl(int))); |
183 | disconnect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); | 186 | disconnect(utilSettings,SIGNAL(activated()), currentView,SLOT(configDialog())); |
184 | } | 187 | } |
185 | 188 | ||
186 | currentView=(KTextEditor::View*)view; | 189 | currentView=(KTextEditor::View*)view; |
187 | 190 | ||
188 | connect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); | 191 | connect(editCopy,SIGNAL(activated()),currentView,SLOT(copy())); |
189 | connect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); | 192 | connect(editCut,SIGNAL(activated()),currentView,SLOT(cut())); |
190 | connect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); | 193 | connect(editPaste,SIGNAL(activated()),currentView,SLOT(paste())); |