Diffstat (limited to 'noncore/apps/tinykate/tinykate.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/tinykate/tinykate.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/noncore/apps/tinykate/tinykate.cpp b/noncore/apps/tinykate/tinykate.cpp index 3c9a637..9865c35 100644 --- a/noncore/apps/tinykate/tinykate.cpp +++ b/noncore/apps/tinykate/tinykate.cpp | |||
@@ -11,24 +11,29 @@ | |||
11 | * This program is free softwaSre; you can redistribute it and/or modify * | 11 | * This program is free softwaSre; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation. * | 13 | * the Free Software Foundation. * |
14 | * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE * | 14 | * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | #include <qaction.h> | ||
18 | #include <qtoolbutton.h> | ||
19 | #include <qmenubar.h> | ||
20 | #include <qpe/resource.h> | ||
21 | #include <qpe/qpeapplication.h> | ||
22 | 17 | ||
18 | #include "tinykate.h" | ||
19 | |||
20 | #include "katedocument.h" | ||
21 | #include "kglobal.h" | ||
22 | |||
23 | /* OPIE */ | ||
24 | #include <opie2/odebug.h> | ||
23 | #include <opie2/ofiledialog.h> | 25 | #include <opie2/ofiledialog.h> |
26 | #include <qpe/resource.h> | ||
27 | #include <qpe/qpeapplication.h> | ||
24 | 28 | ||
25 | #include "tinykate.h" | 29 | /* QT */ |
30 | #include <qaction.h> | ||
31 | #include <qtoolbutton.h> | ||
32 | #include <qmenubar.h> | ||
26 | 33 | ||
27 | #include <katedocument.h> | ||
28 | #include <kglobal.h> | ||
29 | 34 | ||
30 | using namespace Opie::Ui; | 35 | using namespace Opie::Ui; |
31 | TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | 36 | TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : |
32 | QMainWindow( parent, name, f ) | 37 | QMainWindow( parent, name, f ) |
33 | { | 38 | { |
34 | shutDown=false; | 39 | shutDown=false; |
@@ -149,21 +154,21 @@ TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | |||
149 | else slotNew(); | 154 | else slotNew(); |
150 | 155 | ||
151 | } | 156 | } |
152 | 157 | ||
153 | TinyKate::~TinyKate( ) | 158 | TinyKate::~TinyKate( ) |
154 | { | 159 | { |
155 | qWarning("TinyKate destructor\n"); | 160 | owarn << "TinyKate destructor\n" << oendl; |
156 | 161 | ||
157 | shutDown=true; | 162 | shutDown=true; |
158 | while (currentView!=0) { | 163 | while (currentView!=0) { |
159 | slotClose(); | 164 | slotClose(); |
160 | } | 165 | } |
161 | 166 | ||
162 | if( KGlobal::config() != 0 ) { | 167 | if( KGlobal::config() != 0 ) { |
163 | qWarning("deleting KateConfig object..\n"); | 168 | owarn << "deleting KateConfig object..\n" << oendl; |
164 | delete KGlobal::config(); | 169 | delete KGlobal::config(); |
165 | } | 170 | } |
166 | } | 171 | } |
167 | 172 | ||
168 | void TinyKate::slotOpen( ) | 173 | void TinyKate::slotOpen( ) |
169 | { | 174 | { |
@@ -178,13 +183,13 @@ void TinyKate::open(const QString & filename) | |||
178 | { | 183 | { |
179 | KateDocument *kd= new KateDocument(false, false, this,0,this); | 184 | KateDocument *kd= new KateDocument(false, false, this,0,this); |
180 | KTextEditor::View *kv; | 185 | KTextEditor::View *kv; |
181 | QFileInfo fi(filename); | 186 | QFileInfo fi(filename); |
182 | QString filenamed = fi.fileName(); | 187 | QString filenamed = fi.fileName(); |
183 | tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed ); | 188 | tabwidget->addTab(kv=kd->createView(tabwidget,"bLAH"),"tinykate/tinykate", filenamed ); |
184 | qDebug(filename); | 189 | odebug << filename << oendl; |
185 | 190 | ||
186 | kd->setDocName( filenamed); | 191 | kd->setDocName( filenamed); |
187 | kd->open( filename ); | 192 | kd->open( filename ); |
188 | viewCount++; | 193 | viewCount++; |
189 | } | 194 | } |
190 | 195 | ||
@@ -246,13 +251,13 @@ void TinyKate::slotClose( ) | |||
246 | void TinyKate::slotSave() { | 251 | void TinyKate::slotSave() { |
247 | // feel free to make this how you want | 252 | // feel free to make this how you want |
248 | if (currentView==0) return; | 253 | if (currentView==0) return; |
249 | 254 | ||
250 | // KateView *kv = (KateView*) currentView; | 255 | // KateView *kv = (KateView*) currentView; |
251 | KateDocument *kd = (KateDocument*) currentView->document(); | 256 | KateDocument *kd = (KateDocument*) currentView->document(); |
252 | // qDebug("saving file "+kd->docName()); | 257 | // odebug << "saving file "+kd->docName() << oendl; |
253 | if( kd->docName().isEmpty()) | 258 | if( kd->docName().isEmpty()) |
254 | slotSaveAs(); | 259 | slotSaveAs(); |
255 | else | 260 | else |
256 | kd->saveFile(); | 261 | kd->saveFile(); |
257 | // kv->save(); | 262 | // kv->save(); |
258 | // kd->saveFile(); | 263 | // kd->saveFile(); |
@@ -262,13 +267,13 @@ void TinyKate::slotSaveAs() { | |||
262 | if (currentView==0) return; | 267 | if (currentView==0) return; |
263 | KateDocument *kd = (KateDocument*) currentView->document(); | 268 | KateDocument *kd = (KateDocument*) currentView->document(); |
264 | 269 | ||
265 | QString filename= OFileDialog::getSaveFileName(OFileSelector::EXTENDED_ALL, | 270 | QString filename= OFileDialog::getSaveFileName(OFileSelector::EXTENDED_ALL, |
266 | QString::null); | 271 | QString::null); |
267 | if (!filename.isEmpty()) { | 272 | if (!filename.isEmpty()) { |
268 | qDebug("saving file "+filename); | 273 | odebug << "saving file "+filename << oendl; |
269 | QFileInfo fi(filename); | 274 | QFileInfo fi(filename); |
270 | QString filenamed = fi.fileName(); | 275 | QString filenamed = fi.fileName(); |
271 | kd->setDocFile( filename); | 276 | kd->setDocFile( filename); |
272 | kd->setDocName( filenamed); | 277 | kd->setDocName( filenamed); |
273 | kd->saveFile(); | 278 | kd->saveFile(); |
274 | // KTextEditor::View *dv = currentView; | 279 | // KTextEditor::View *dv = currentView; |