Diffstat (limited to 'noncore/apps/tinykate/tinykate.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/tinykate/tinykate.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/noncore/apps/tinykate/tinykate.cpp b/noncore/apps/tinykate/tinykate.cpp index 03c6e50..f177e47 100644 --- a/noncore/apps/tinykate/tinykate.cpp +++ b/noncore/apps/tinykate/tinykate.cpp | |||
@@ -23,2 +23,3 @@ | |||
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | #include <qpe/qpeapplication.h> | ||
24 | 25 | ||
@@ -39,3 +40,5 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | |||
39 | { | 40 | { |
41 | nextUnnamed=0; | ||
40 | currentView=0; | 42 | currentView=0; |
43 | viewCount=0; | ||
41 | setCaption(tr("TinyKATE")); | 44 | setCaption(tr("TinyKATE")); |
@@ -139,2 +142,5 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | |||
139 | 142 | ||
143 | if( qApp->argc() > 1) open(qApp->argv()[1]); | ||
144 | else slotNew(); | ||
145 | |||
140 | } | 146 | } |
@@ -146,8 +152,14 @@ void TinyKate::slotOpen( ) | |||
146 | if (!filename.isEmpty()) { | 152 | if (!filename.isEmpty()) { |
153 | open(filename); | ||
154 | } | ||
155 | } | ||
156 | |||
157 | void TinyKate::open(const QString & filename) | ||
158 | { | ||
147 | KateDocument *kd= new KateDocument(false, false, this,0,this); | 159 | KateDocument *kd= new KateDocument(false, false, this,0,this); |
148 | KTextEditor::View *kv; | 160 | KTextEditor::View *kv; |
149 | tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"BLAH","BLAH"); | 161 | tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate","BLAH"); |
150 | qDebug(filename); | 162 | qDebug(filename); |
151 | kd->open(filename); | 163 | kd->open(filename); |
152 | } | 164 | viewCount++; |
153 | } | 165 | } |
@@ -186,4 +198,4 @@ void TinyKate::slotNew( ) | |||
186 | KTextEditor::View *kv; | 198 | KTextEditor::View *kv; |
187 | tabwidget->addTab(kv=kd->createView(tabwidget,"BLAH"),"BLAH",tr("Unnamed %1").arg(0)); | 199 | tabwidget->addTab(kv=kd->createView(tabwidget,"BLAH"),"tinykate/tinykate",tr("Unnamed %1").arg(nextUnnamed++)); |
188 | 200 | viewCount++; | |
189 | } | 201 | } |
@@ -197,2 +209,4 @@ void TinyKate::slotClose( ) | |||
197 | delete dv->document(); | 209 | delete dv->document(); |
210 | viewCount--; | ||
211 | if (!viewCount) slotNew(); | ||
198 | } | 212 | } |