summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2005-08-04 07:14:03 (UTC)
committer llornkcor <llornkcor>2005-08-04 07:14:03 (UTC)
commit32743ebb00d374ad18afbed69ab3e94b03699a57 (patch) (side-by-side diff)
treeef73f41d2a76c15f0c31f0bcdec9fbf63ba5743f
parent30a5df87b42e35c48932a2041944e59021568f38 (diff)
downloadopie-32743ebb00d374ad18afbed69ab3e94b03699a57.zip
opie-32743ebb00d374ad18afbed69ab3e94b03699a57.tar.gz
opie-32743ebb00d374ad18afbed69ab3e94b03699a57.tar.bz2
fix # 0001687: opening desktop file
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/mainwindow/tinykate.cpp5
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
@@ -200,14 +200,13 @@ void TinyKate::slotOpen( )
void TinyKate::open(const QString & filename)
{
KateDocument *kd= new KateDocument(false, false, this,0,this);
KTextEditor::View *kv;
QString realFileName;
//check if filename is a .desktop file
- if ( filename.find( ".desktop", 0, true ) )
- {
+ if ( filename.find( ".desktop", 0, true ) != -1 ) {
switch ( QMessageBox::warning( this, tr( "TinyKATE" ),
tr("TinyKATE has detected<BR>you selected a <B>.desktop</B> file.<BR>Open <B>.desktop</B> file or <B>linked</B> file?" ),
tr(".desktop File"),
tr("Linked Document"), 0, 1, 1 ) )
{
case 0: //desktop
@@ -215,12 +214,14 @@ void TinyKate::open(const QString & filename)
break;
case 1: //linked
DocLnk docLnk( filename );
realFileName = docLnk.file();
break;
};
+ } else {
+ realFileName = filename;
}
QFileInfo fileInfo( realFileName );
QString filenamed = fileInfo.fileName();
tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed );
odebug << realFileName << oendl;