-rw-r--r-- | noncore/apps/tinykate/mainwindow/tinykate.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/apps/tinykate/mainwindow/tinykate.cpp b/noncore/apps/tinykate/mainwindow/tinykate.cpp index bbb0be7e..e808a2e 100644 --- a/noncore/apps/tinykate/mainwindow/tinykate.cpp +++ b/noncore/apps/tinykate/mainwindow/tinykate.cpp | |||
@@ -198,31 +198,32 @@ void TinyKate::slotOpen( ) | |||
198 | } | 198 | } |
199 | 199 | ||
200 | void TinyKate::open(const QString & filename) | 200 | void TinyKate::open(const QString & filename) |
201 | { | 201 | { |
202 | KateDocument *kd= new KateDocument(false, false, this,0,this); | 202 | KateDocument *kd= new KateDocument(false, false, this,0,this); |
203 | KTextEditor::View *kv; | 203 | KTextEditor::View *kv; |
204 | QString realFileName; | 204 | QString realFileName; |
205 | //check if filename is a .desktop file | 205 | //check if filename is a .desktop file |
206 | if ( filename.find( ".desktop", 0, true ) ) | 206 | if ( filename.find( ".desktop", 0, true ) != -1 ) { |
207 | { | ||
208 | switch ( QMessageBox::warning( this, tr( "TinyKATE" ), | 207 | switch ( QMessageBox::warning( this, tr( "TinyKATE" ), |
209 | tr("TinyKATE has detected<BR>you selected a <B>.desktop</B> file.<BR>Open <B>.desktop</B> file or <B>linked</B> file?" ), | 208 | tr("TinyKATE has detected<BR>you selected a <B>.desktop</B> file.<BR>Open <B>.desktop</B> file or <B>linked</B> file?" ), |
210 | tr(".desktop File"), | 209 | tr(".desktop File"), |
211 | tr("Linked Document"), 0, 1, 1 ) ) | 210 | tr("Linked Document"), 0, 1, 1 ) ) |
212 | { | 211 | { |
213 | case 0: //desktop | 212 | case 0: //desktop |
214 | realFileName = filename; | 213 | realFileName = filename; |
215 | break; | 214 | break; |
216 | case 1: //linked | 215 | case 1: //linked |
217 | DocLnk docLnk( filename ); | 216 | DocLnk docLnk( filename ); |
218 | realFileName = docLnk.file(); | 217 | realFileName = docLnk.file(); |
219 | break; | 218 | break; |
220 | }; | 219 | }; |
220 | } else { | ||
221 | realFileName = filename; | ||
221 | } | 222 | } |
222 | 223 | ||
223 | QFileInfo fileInfo( realFileName ); | 224 | QFileInfo fileInfo( realFileName ); |
224 | QString filenamed = fileInfo.fileName(); | 225 | QString filenamed = fileInfo.fileName(); |
225 | tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed ); | 226 | tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed ); |
226 | odebug << realFileName << oendl; | 227 | odebug << realFileName << oendl; |
227 | 228 | ||
228 | kd->setDocName( filenamed); | 229 | kd->setDocName( filenamed); |