Browse Source

Rename a number of classes to enhance compatibility with KDE4

tags/r14.0.0
Timothy Pearson 6 years ago
parent
commit
6d33c9774c

+ 1
- 1
README View File

@@ -71,7 +71,7 @@ v0.85 adds a lot:
71 71
   type stuff like "3 sin pi" without having to manually add the * in between
72 72
   3 and sin.  This also works with numbers and variables, and numbers and
73 73
   parenthesized expressions.
74
-* GUI changes.  The main result view now uses KListView, so it gains tooltip
74
+* GUI changes.  The main result view now uses TDEListView, so it gains tooltip
75 75
   support for long answers for free, along with a bevy of other improvements.
76 76
 * You can right-click on an answer and copy it to the clipboard.
77 77
 * Corrected information in the about box.

+ 3
- 3
src/abakuslistview.cpp View File

@@ -30,7 +30,7 @@
30 30
 #include "function.h"
31 31
 
32 32
 ListView::ListView(TQWidget *parent, const char *name) :
33
-    KListView(parent, name), m_menu(0), m_usePopup(false), m_removeSingleId(0),
33
+    TDEListView(parent, name), m_menu(0), m_usePopup(false), m_removeSingleId(0),
34 34
     m_removeAllId(0)
35 35
 {
36 36
     setResizeMode(LastColumn);
@@ -68,7 +68,7 @@ void ListView::enablePopupHandler(bool enable)
68 68
 	if(m_menu)
69 69
 	    kdError() << "ListView menu shouldn't exist here!\n";
70 70
 
71
-	m_menu = new KPopupMenu(this);
71
+	m_menu = new TDEPopupMenu(this);
72 72
 
73 73
 	m_removeSingleId = m_menu->insertItem(removeItemString(), this, TQT_SLOT(removeSelected()));
74 74
 	m_removeAllId = m_menu->insertItem("Placeholder", this, TQT_SLOT(removeAllItems()));
@@ -124,7 +124,7 @@ void ListView::removeSelected()
124 124
 
125 125
 ValueListViewItem::ValueListViewItem(TQListView *listView, const TQString &name,
126 126
 	const Abakus::number_t &value) :
127
-    KListViewItem(listView, name), m_value(value)
127
+    TDEListViewItem(listView, name), m_value(value)
128 128
 {
129 129
     valueChanged();
130 130
 }

+ 4
- 4
src/abakuslistview.h View File

@@ -23,9 +23,9 @@
23 23
 
24 24
 #include "numerictypes.h"
25 25
 
26
-class KPopupMenu;
26
+class TDEPopupMenu;
27 27
 
28
-class ListView : public KListView
28
+class ListView : public TDEListView
29 29
 {
30 30
     Q_OBJECT
31 31
   
@@ -83,14 +83,14 @@ class ListView : public KListView
83 83
     void removeSelected();
84 84
 
85 85
     private:
86
-    KPopupMenu *m_menu;
86
+    TDEPopupMenu *m_menu;
87 87
     bool m_usePopup;
88 88
 
89 89
     int m_removeSingleId;
90 90
     int m_removeAllId;
91 91
 };
92 92
 
93
-class ValueListViewItem : public KListViewItem
93
+class ValueListViewItem : public TDEListViewItem
94 94
 {
95 95
     public:
96 96
     ValueListViewItem (TQListView *listView, const TQString &name, const Abakus::number_t &value);

+ 55
- 55
src/mainwindow.cpp View File

@@ -50,7 +50,7 @@
50 50
 #include "abakuslistview.h"
51 51
 #include "result.h"
52 52
 
53
-MainWindow::MainWindow() : KMainWindow(0, "abakus-mainwindow"), m_popup(0), m_insert(false)
53
+MainWindow::MainWindow() : TDEMainWindow(0, "abakus-mainwindow"), m_popup(0), m_insert(false)
54 54
 {
55 55
     m_mainSplitter = new TQSplitter(this);
56 56
     TQWidget *box = new TQWidget(m_mainSplitter);
@@ -156,36 +156,36 @@ MainWindow::MainWindow() : KMainWindow(0, "abakus-mainwindow"), m_popup(0), m_in
156 156
 
157 157
 bool MainWindow::inRPNMode() const
158 158
 {
159
-    return action<KToggleAction>("toggleExpressionMode")->isChecked();
159
+    return action<TDEToggleAction>("toggleExpressionMode")->isChecked();
160 160
 }
161 161
 
162 162
 bool MainWindow::eventFilter(TQObject *o, TQEvent *e)
163 163
 {
164
-    return KMainWindow::eventFilter(o, e);
164
+    return TDEMainWindow::eventFilter(o, e);
165 165
 }
166 166
 
167 167
 bool MainWindow::queryExit()
168 168
 {
169 169
     saveConfig();
170
-    return KMainWindow::queryExit();
170
+    return TDEMainWindow::queryExit();
171 171
 }
172 172
 
173 173
 void MainWindow::contextMenuEvent(TQContextMenuEvent *e)
174 174
 {
175
-    static KPopupMenu *popup = 0;
175
+    static TDEPopupMenu *popup = 0;
176 176
 
177 177
     if(!popup) {
178
-        popup = new KPopupMenu(this);
178
+        popup = new TDEPopupMenu(this);
179 179
         action("options_show_menubar")->plug(popup);
180 180
     }
181 181
 
182
-    if(!action<KToggleAction>("options_show_menubar")->isChecked())
182
+    if(!action<TDEToggleAction>("options_show_menubar")->isChecked())
183 183
         popup->popup(e->globalPos());
184 184
 }
185 185
 
186 186
 void MainWindow::polish()
187 187
 {
188
-    KMainWindow::polish();
188
+    TDEMainWindow::polish();
189 189
     loadConfig();
190 190
 }
191 191
 
@@ -326,7 +326,7 @@ void MainWindow::slotDegrees()
326 326
     setTrigMode(Abakus::Degrees);
327 327
     m_degrees->setChecked(true);
328 328
     if(action("setDegreesMode"))
329
-        action<KToggleAction>("setDegreesMode")->setChecked(true);
329
+        action<TDEToggleAction>("setDegreesMode")->setChecked(true);
330 330
 }
331 331
 
332 332
 void MainWindow::slotRadians()
@@ -334,7 +334,7 @@ void MainWindow::slotRadians()
334 334
     setTrigMode(Abakus::Radians);
335 335
     m_radians->setChecked(true);
336 336
     if(action("setRadiansMode"))
337
-        action<KToggleAction>("setRadiansMode")->setChecked(true);
337
+        action<TDEToggleAction>("setRadiansMode")->setChecked(true);
338 338
 }
339 339
 
340 340
 int MainWindow::getParenthesesLevel(const TQString &str)
@@ -366,7 +366,7 @@ void MainWindow::loadConfig()
366 366
         }
367 367
 
368 368
         bool useRPN = config.readBoolEntry("Use RPN Mode", false);
369
-        action<KToggleAction>("toggleExpressionMode")->setChecked(useRPN);
369
+        action<TDEToggleAction>("toggleExpressionMode")->setChecked(useRPN);
370 370
 
371 371
         int precision = config.readNumEntry("Decimal Precision", -1);
372 372
         if(precision < -1 || precision > 75)
@@ -395,20 +395,20 @@ void MainWindow::loadConfig()
395 395
         TDEConfigGroup config(TDEGlobal::config(), "GUI");
396 396
 
397 397
         bool showHistory = config.readBoolEntry("ShowHistory", true);
398
-        action<KToggleAction>("toggleHistoryList")->setChecked(showHistory);
398
+        action<TDEToggleAction>("toggleHistoryList")->setChecked(showHistory);
399 399
         m_history->setShown(showHistory);
400 400
 
401 401
         bool showFunctions = config.readBoolEntry("ShowFunctions", true);
402
-        action<KToggleAction>("toggleFunctionList")->setChecked(showFunctions);
402
+        action<TDEToggleAction>("toggleFunctionList")->setChecked(showFunctions);
403 403
         m_fnList->setShown(showFunctions);
404 404
 
405 405
         bool showVariables = config.readBoolEntry("ShowVariables", true);
406
-        action<KToggleAction>("toggleVariableList")->setChecked(showVariables);
406
+        action<TDEToggleAction>("toggleVariableList")->setChecked(showVariables);
407 407
         m_varList->setShown(showVariables);
408 408
 
409 409
         bool compactMode = config.readBoolEntry("InCompactMode", false);
410 410
         compactMode = compactMode || !showHistory;
411
-        action<KToggleAction>("toggleCompactMode")->setChecked(compactMode);
411
+        action<TDEToggleAction>("toggleCompactMode")->setChecked(compactMode);
412 412
 
413 413
         if(compactMode)
414 414
             TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotToggleCompactMode()));
@@ -463,7 +463,7 @@ void MainWindow::saveConfig()
463 463
 
464 464
     {
465 465
         TDEConfigGroup config(TDEGlobal::config(), "GUI");
466
-        bool inCompactMode = action<KToggleAction>("toggleCompactMode")->isChecked();
466
+        bool inCompactMode = action<TDEToggleAction>("toggleCompactMode")->isChecked();
467 467
 
468 468
         config.writeEntry("InCompactMode", inCompactMode);
469 469
 
@@ -501,62 +501,62 @@ void MainWindow::saveConfig()
501 501
 
502 502
 void MainWindow::setupLayout()
503 503
 {
504
-    KActionCollection *ac = actionCollection();
504
+    TDEActionCollection *ac = actionCollection();
505 505
 
506 506
     KStdAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(quit()), ac);
507 507
     KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(slotToggleMenuBar()), ac);
508 508
 
509
-    KToggleAction *ta = new KToggleAction(i18n("&Degrees"), SHIFT + ALT + Key_D, TQT_TQOBJECT(this), TQT_SLOT(slotDegrees()), ac, "setDegreesMode");
509
+    TDEToggleAction *ta = new TDEToggleAction(i18n("&Degrees"), SHIFT + ALT + Key_D, TQT_TQOBJECT(this), TQT_SLOT(slotDegrees()), ac, "setDegreesMode");
510 510
     ta->setExclusiveGroup("TrigMode");
511 511
     ta->setChecked(trigMode() == Abakus::Degrees);
512 512
 
513
-    ta = new KToggleAction(i18n("&Radians"), SHIFT + ALT + Key_R, TQT_TQOBJECT(this), TQT_SLOT(slotRadians()), ac, "setRadiansMode");
513
+    ta = new TDEToggleAction(i18n("&Radians"), SHIFT + ALT + Key_R, TQT_TQOBJECT(this), TQT_SLOT(slotRadians()), ac, "setRadiansMode");
514 514
     ta->setExclusiveGroup("TrigMode");
515 515
     ta->setChecked(trigMode() == Abakus::Radians);
516 516
 
517
-    ta = new KToggleAction(i18n("Show &History List"), SHIFT + ALT + Key_H, TQT_TQOBJECT(this), TQT_SLOT(slotToggleHistoryList()), ac, "toggleHistoryList");
517
+    ta = new TDEToggleAction(i18n("Show &History List"), SHIFT + ALT + Key_H, TQT_TQOBJECT(this), TQT_SLOT(slotToggleHistoryList()), ac, "toggleHistoryList");
518 518
     ta->setChecked(true);
519 519
 
520
-    ta = new KToggleAction(i18n("Show &Variables"), SHIFT + ALT + Key_V, TQT_TQOBJECT(this), TQT_SLOT(slotToggleVariableList()), ac, "toggleVariableList");
520
+    ta = new TDEToggleAction(i18n("Show &Variables"), SHIFT + ALT + Key_V, TQT_TQOBJECT(this), TQT_SLOT(slotToggleVariableList()), ac, "toggleVariableList");
521 521
     ta->setChecked(true);
522 522
 
523
-    ta = new KToggleAction(i18n("Show &Functions"), SHIFT + ALT + Key_F, TQT_TQOBJECT(this), TQT_SLOT(slotToggleFunctionList()), ac, "toggleFunctionList");
523
+    ta = new TDEToggleAction(i18n("Show &Functions"), SHIFT + ALT + Key_F, TQT_TQOBJECT(this), TQT_SLOT(slotToggleFunctionList()), ac, "toggleFunctionList");
524 524
     ta->setChecked(true);
525 525
 
526
-    ta = new KToggleAction(i18n("Activate &Compact Mode"), SHIFT + ALT + Key_C, TQT_TQOBJECT(this), TQT_SLOT(slotToggleCompactMode()), ac, "toggleCompactMode");
526
+    ta = new TDEToggleAction(i18n("Activate &Compact Mode"), SHIFT + ALT + Key_C, TQT_TQOBJECT(this), TQT_SLOT(slotToggleCompactMode()), ac, "toggleCompactMode");
527 527
     ta->setChecked(false);
528 528
 
529
-    ta = new KToggleAction(i18n("Use R&PN Mode"), SHIFT + ALT + Key_P, TQT_TQOBJECT(this), TQT_SLOT(slotToggleExpressionMode()), ac, "toggleExpressionMode");
529
+    ta = new TDEToggleAction(i18n("Use R&PN Mode"), SHIFT + ALT + Key_P, TQT_TQOBJECT(this), TQT_SLOT(slotToggleExpressionMode()), ac, "toggleExpressionMode");
530 530
     ta->setChecked(false);
531 531
 
532 532
     // Precision actions.
533
-    ta = new KToggleAction(i18n("&Automatic Precision"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecisionAuto()), ac, "precisionAuto");
533
+    ta = new TDEToggleAction(i18n("&Automatic Precision"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecisionAuto()), ac, "precisionAuto");
534 534
     ta->setExclusiveGroup("Precision");
535 535
     ta->setChecked(true);
536 536
 
537
-    ta = new KToggleAction(i18n("&3 Decimal Digits"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecision3()), ac, "precision3");
537
+    ta = new TDEToggleAction(i18n("&3 Decimal Digits"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecision3()), ac, "precision3");
538 538
     ta->setExclusiveGroup("Precision");
539 539
     ta->setChecked(false);
540 540
 
541
-    ta = new KToggleAction(i18n("&8 Decimal Digits"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecision8()), ac, "precision8");
541
+    ta = new TDEToggleAction(i18n("&8 Decimal Digits"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecision8()), ac, "precision8");
542 542
     ta->setExclusiveGroup("Precision");
543 543
     ta->setChecked(false);
544 544
 
545
-    ta = new KToggleAction(i18n("&15 Decimal Digits"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecision15()), ac, "precision15");
545
+    ta = new TDEToggleAction(i18n("&15 Decimal Digits"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecision15()), ac, "precision15");
546 546
     ta->setExclusiveGroup("Precision");
547 547
     ta->setChecked(false);
548 548
 
549
-    ta = new KToggleAction(i18n("&50 Decimal Digits"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecision50()), ac, "precision50");
549
+    ta = new TDEToggleAction(i18n("&50 Decimal Digits"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecision50()), ac, "precision50");
550 550
     ta->setExclusiveGroup("Precision");
551 551
     ta->setChecked(false);
552 552
 
553
-    ta = new KToggleAction(i18n("C&ustom Precision..."), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecisionCustom()), ac, "precisionCustom");
553
+    ta = new TDEToggleAction(i18n("C&ustom Precision..."), 0, TQT_TQOBJECT(this), TQT_SLOT(slotPrecisionCustom()), ac, "precisionCustom");
554 554
     ta->setExclusiveGroup("Precision");
555 555
     ta->setChecked(false);
556 556
 
557
-    new KAction(i18n("Clear &History"), "editclear", SHIFT + ALT + Key_L, TQT_TQOBJECT(m_result), TQT_SLOT(clear()), ac, "clearHistory");
557
+    new TDEAction(i18n("Clear &History"), "editclear", SHIFT + ALT + Key_L, TQT_TQOBJECT(m_result), TQT_SLOT(clear()), ac, "clearHistory");
558 558
 
559
-    new KAction(i18n("Select Editor"), "goto", Key_F6, TQT_TQOBJECT(m_edit), TQT_SLOT(setFocus()), ac, "select_edit");
559
+    new TDEAction(i18n("Select Editor"), "goto", Key_F6, TQT_TQOBJECT(m_edit), TQT_SLOT(setFocus()), ac, "select_edit");
560 560
 }
561 561
 
562 562
 void MainWindow::populateListViews()
@@ -570,7 +570,7 @@ void MainWindow::populateListViews()
570 570
     new ValueListViewItem(m_varList, "e", value);
571 571
 }
572 572
 
573
-KAction *MainWindow::action(const char *key) const
573
+TDEAction *MainWindow::action(const char *key) const
574 574
 {
575 575
     return actionCollection()->action(key);
576 576
 }
@@ -593,38 +593,38 @@ void MainWindow::slotToggleMenuBar()
593 593
 
594 594
 void MainWindow::slotToggleFunctionList()
595 595
 {
596
-    bool show = action<KToggleAction>("toggleFunctionList")->isChecked();
596
+    bool show = action<TDEToggleAction>("toggleFunctionList")->isChecked();
597 597
     m_fnList->setShown(show);
598 598
 
599 599
     if(!m_history->isShown()) {
600 600
         m_history->setShown(true);
601
-        action<KToggleAction>("toggleHistoryList")->setChecked(true);
601
+        action<TDEToggleAction>("toggleHistoryList")->setChecked(true);
602 602
         slotToggleHistoryList();
603 603
     }
604 604
 
605
-    action<KToggleAction>("toggleCompactMode")->setChecked(false);
605
+    action<TDEToggleAction>("toggleCompactMode")->setChecked(false);
606 606
 }
607 607
 
608 608
 void MainWindow::slotToggleVariableList()
609 609
 {
610
-    bool show = action<KToggleAction>("toggleVariableList")->isChecked();
610
+    bool show = action<TDEToggleAction>("toggleVariableList")->isChecked();
611 611
     m_varList->setShown(show);
612 612
 
613 613
     if(!m_history->isShown()) {
614 614
         m_history->setShown(true);
615
-        action<KToggleAction>("toggleHistoryList")->setChecked(true);
615
+        action<TDEToggleAction>("toggleHistoryList")->setChecked(true);
616 616
         slotToggleHistoryList();
617 617
     }
618 618
 
619
-    action<KToggleAction>("toggleCompactMode")->setChecked(false);
619
+    action<TDEToggleAction>("toggleCompactMode")->setChecked(false);
620 620
 }
621 621
 
622 622
 void MainWindow::slotToggleHistoryList()
623 623
 {
624
-    bool show = action<KToggleAction>("toggleHistoryList")->isChecked();
624
+    bool show = action<TDEToggleAction>("toggleHistoryList")->isChecked();
625 625
     m_history->setShown(show);
626 626
 
627
-    action<KToggleAction>("toggleCompactMode")->setChecked(false);
627
+    action<TDEToggleAction>("toggleCompactMode")->setChecked(false);
628 628
 }
629 629
 
630 630
 void MainWindow::slotNewFunction(const TQString &name)
@@ -634,7 +634,7 @@ void MainWindow::slotNewFunction(const TQString &name)
634 634
     TQString fnName = TQString("%1(%2)").arg(name, userFn->varName);
635 635
     TQString expr = fn->operand()->infixString();
636 636
 
637
-    new KListViewItem(m_fnList, fnName, expr);
637
+    new TDEListViewItem(m_fnList, fnName, expr);
638 638
 }
639 639
 
640 640
 void MainWindow::slotRemoveFunction(const TQString &name)
@@ -667,7 +667,7 @@ void MainWindow::slotRemoveValue(const TQString &name)
667 667
 
668 668
 void MainWindow::slotToggleCompactMode()
669 669
 {
670
-    if(action<KToggleAction>("toggleCompactMode")->isChecked()) {
670
+    if(action<TDEToggleAction>("toggleCompactMode")->isChecked()) {
671 671
         m_wasFnShown = m_fnList->isShown();
672 672
         m_wasVarShown = m_varList->isShown();
673 673
         m_wasHistoryShown = m_history->isShown();
@@ -676,9 +676,9 @@ void MainWindow::slotToggleCompactMode()
676 676
         m_varList->setShown(false);
677 677
         m_history->setShown(false);
678 678
 
679
-        action<KToggleAction>("toggleFunctionList")->setChecked(false);
680
-        action<KToggleAction>("toggleVariableList")->setChecked(false);
681
-        action<KToggleAction>("toggleHistoryList")->setChecked(false);
679
+        action<TDEToggleAction>("toggleFunctionList")->setChecked(false);
680
+        action<TDEToggleAction>("toggleVariableList")->setChecked(false);
681
+        action<TDEToggleAction>("toggleHistoryList")->setChecked(false);
682 682
 
683 683
         m_oldSize = size();
684 684
         m_newSize = TQSize(0, 0);
@@ -689,9 +689,9 @@ void MainWindow::slotToggleCompactMode()
689 689
         m_varList->setShown(m_wasVarShown);
690 690
         m_history->setShown(m_wasHistoryShown);
691 691
 
692
-        action<KToggleAction>("toggleFunctionList")->setChecked(m_wasFnShown);
693
-        action<KToggleAction>("toggleVariableList")->setChecked(m_wasVarShown);
694
-        action<KToggleAction>("toggleHistoryList")->setChecked(m_wasHistoryShown);
692
+        action<TDEToggleAction>("toggleFunctionList")->setChecked(m_wasFnShown);
693
+        action<TDEToggleAction>("toggleVariableList")->setChecked(m_wasVarShown);
694
+        action<TDEToggleAction>("toggleHistoryList")->setChecked(m_wasHistoryShown);
695 695
 
696 696
         m_newSize = m_oldSize;
697 697
         TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(slotUpdateSize()));
@@ -796,27 +796,27 @@ void MainWindow::selectCorrectPrecisionAction()
796 796
 {
797 797
     switch(Abakus::m_prec) {
798 798
         case 3:
799
-            action<KToggleAction>("precision3")->setChecked(true);
799
+            action<TDEToggleAction>("precision3")->setChecked(true);
800 800
         break;
801 801
 
802 802
         case 8:
803
-            action<KToggleAction>("precision8")->setChecked(true);
803
+            action<TDEToggleAction>("precision8")->setChecked(true);
804 804
         break;
805 805
 
806 806
         case 15:
807
-            action<KToggleAction>("precision15")->setChecked(true);
807
+            action<TDEToggleAction>("precision15")->setChecked(true);
808 808
         break;
809 809
 
810 810
         case 50:
811
-            action<KToggleAction>("precision50")->setChecked(true);
811
+            action<TDEToggleAction>("precision50")->setChecked(true);
812 812
         break;
813 813
 
814 814
         case -1:
815
-            action<KToggleAction>("precisionAuto")->setChecked(true);
815
+            action<TDEToggleAction>("precisionAuto")->setChecked(true);
816 816
         break;
817 817
 
818 818
         default:
819
-            action<KToggleAction>("precisionCustom")->setChecked(true);
819
+            action<TDEToggleAction>("precisionCustom")->setChecked(true);
820 820
     }
821 821
 }
822 822
 

+ 7
- 7
src/mainwindow.h View File

@@ -34,16 +34,16 @@ class TQTimer;
34 34
 
35 35
 //class KComboBox;
36 36
 class Editor;
37
-class KPopupMenu;
38
-class KAction;
39
-class KListView;
37
+class TDEPopupMenu;
38
+class TDEAction;
39
+class TDEListView;
40 40
 class ResultListView;
41 41
 class ResultListViewText;
42 42
 
43 43
 class AbakusIface;
44 44
 
45 45
 // Main window class, handles events and layout and stuff
46
-class MainWindow : public KMainWindow
46
+class MainWindow : public TDEMainWindow
47 47
 {
48 48
     Q_OBJECT
49 49
   
@@ -105,7 +105,7 @@ class MainWindow : public KMainWindow
105 105
     TQString interpolateExpression(const TQString &text, ResultListViewText *after);
106 106
 
107 107
     // Donated via JuK
108
-    KAction *action(const char *key) const;
108
+    TDEAction *action(const char *key) const;
109 109
 
110 110
     template <class T> T *action(const char *key) const
111 111
     {
@@ -117,11 +117,11 @@ class MainWindow : public KMainWindow
117 117
     TQRadioButton *m_degrees;
118 118
     TQRadioButton *m_radians;
119 119
     Editor *m_edit;
120
-    KPopupMenu *m_popup;
120
+    TDEPopupMenu *m_popup;
121 121
     ResultListView *m_result;
122 122
     TQString m_lastError;
123 123
     TQBoxLayout *m_layout;
124
-    KListView *m_fnList, *m_varList;
124
+    TDEListView *m_fnList, *m_varList;
125 125
     TQSplitter *m_mainSplitter, *m_listSplitter;
126 126
     TQSize m_newSize, m_oldSize;
127 127
 

+ 5
- 5
src/resultlistview.cpp View File

@@ -35,7 +35,7 @@ using DragSupport::makePixmap;
35 35
 using namespace ResultList;
36 36
 
37 37
 ResultListView::ResultListView(TQWidget *parent, const char *name) :
38
-    KListView(parent, name), m_itemRightClicked(0)
38
+    TDEListView(parent, name), m_itemRightClicked(0)
39 39
 {
40 40
     connect(this, TQT_SIGNAL(doubleClicked(TQListViewItem *, const TQPoint &, int)),
41 41
                   TQT_SLOT(slotDoubleClicked(TQListViewItem *, const TQPoint &, int)));
@@ -94,7 +94,7 @@ TQDragObject *ResultListView::dragObject()
94 94
 void ResultListView::contextMenuEvent(TQContextMenuEvent *e)
95 95
 {
96 96
     m_itemRightClicked = itemUnderCursor();
97
-    KPopupMenu *menu = constructPopupMenu(m_itemRightClicked);
97
+    TDEPopupMenu *menu = constructPopupMenu(m_itemRightClicked);
98 98
 
99 99
     menu->popup(e->globalPos());
100 100
 }
@@ -111,9 +111,9 @@ void ResultListView::slotDoubleClicked(TQListViewItem *item, const TQPoint &, in
111 111
 	emit signalResultSelected(textItem->resultText());
112 112
 }
113 113
 
114
-KPopupMenu *ResultListView::constructPopupMenu(const ResultListViewText *item)
114
+TDEPopupMenu *ResultListView::constructPopupMenu(const ResultListViewText *item)
115 115
 {
116
-    KPopupMenu *menu = new KPopupMenu(this, "list view context menu");
116
+    TDEPopupMenu *menu = new TDEPopupMenu(this, "list view context menu");
117 117
 
118 118
     menu->insertItem(i18n("Clear &History"), this, TQT_SLOT(clear()), ALT+Key_R);
119 119
 
@@ -136,7 +136,7 @@ void ResultListView::slotCopyResult()
136 136
 
137 137
 ResultListViewText *ResultListView::lastItem() const
138 138
 {
139
-    return static_cast<ResultListViewText *>(KListView::lastItem());
139
+    return static_cast<ResultListViewText *>(TDEListView::lastItem());
140 140
 }
141 141
 
142 142
 ResultListViewText *ResultListView::itemUnderCursor() const

+ 3
- 3
src/resultlistview.h View File

@@ -22,7 +22,7 @@
22 22
 #include <klistview.h>
23 23
 #include "numerictypes.h"
24 24
 
25
-class KPopupMenu;
25
+class TDEPopupMenu;
26 26
 class TQLabel;
27 27
 class TQDragObject;
28 28
 class ResultListViewText;
@@ -31,7 +31,7 @@ namespace ResultList {
31 31
     enum { ExpressionColumn = 0, ResultColumn, ShortcutColumn };
32 32
 }
33 33
 
34
-class ResultListView : public KListView
34
+class ResultListView : public TDEListView
35 35
 {
36 36
     Q_OBJECT
37 37
   
@@ -56,7 +56,7 @@ class ResultListView : public KListView
56 56
     void slotCopyResult();
57 57
 
58 58
     private:
59
-    KPopupMenu *constructPopupMenu(const ResultListViewText *item);
59
+    TDEPopupMenu *constructPopupMenu(const ResultListViewText *item);
60 60
     ResultListViewText *itemUnderCursor() const;
61 61
 
62 62
     ResultListViewText *m_itemRightClicked;

+ 10
- 10
src/resultlistviewtext.cpp View File

@@ -28,24 +28,24 @@
28 28
 
29 29
 using namespace ResultList;
30 30
 
31
-ResultListViewText::ResultListViewText(KListView *listView,
31
+ResultListViewText::ResultListViewText(TDEListView *listView,
32 32
                                      const TQString &text,
33 33
 				     const TQString &result,
34 34
 				     ResultListViewText *after,
35 35
 				     bool isError)
36
-    : KListViewItem(listView, after, text, result), m_text(text),
36
+    : TDEListViewItem(listView, after, text, result), m_text(text),
37 37
       m_result(result), m_wasError(isError), m_stackPosition(0)
38 38
 {
39 39
     // This is some kind of non-result answer, don't bother worrying about the
40 40
     // stack status, it hasn't changed.
41 41
 }
42 42
 
43
-ResultListViewText::ResultListViewText(KListView *listView,
43
+ResultListViewText::ResultListViewText(TDEListView *listView,
44 44
                                      const TQString &text,
45 45
 				     const Abakus::number_t &result,
46 46
 				     ResultListViewText *after,
47 47
 				     bool isError)
48
-    : KListViewItem(listView, after, text), m_text(text),
48
+    : TDEListViewItem(listView, after, text), m_text(text),
49 49
       m_result(result.toString()), m_wasError(isError), m_stackPosition(0),
50 50
       m_value(result)
51 51
 {
@@ -102,7 +102,7 @@ void ResultListViewText::paintCell(TQPainter *p, const TQColorGroup &cg, int col
102 102
 	p->setFont(f);
103 103
     }
104 104
 
105
-    KListViewItem::paintCell(p, group, column, width, align);
105
+    TDEListViewItem::paintCell(p, group, column, width, align);
106 106
 }
107 107
 
108 108
 int ResultListViewText::width(const TQFontMetrics &fm, const TQListView *lv, int c) const
@@ -111,25 +111,25 @@ int ResultListViewText::width(const TQFontMetrics &fm, const TQListView *lv, int
111 111
     if(c == ResultColumn) {
112 112
 	TQFont f = lv->font();
113 113
 	f.setBold(true);
114
-	return KListViewItem::width(TQFontMetrics(f), lv, c);
114
+	return TDEListViewItem::width(TQFontMetrics(f), lv, c);
115 115
     }
116 116
 
117 117
     if(c == ShortcutColumn) {
118 118
 	TQFont f = lv->font();
119 119
 	f.setItalic(true);
120 120
 	f.setPointSize(TQMIN(f.pointSize() * 9 / 11, 10));
121
-	return KListViewItem::width(TQFontMetrics(f), lv, c);
121
+	return TDEListViewItem::width(TQFontMetrics(f), lv, c);
122 122
     }
123 123
 
124
-    return KListViewItem::width(fm, lv, c);
124
+    return TDEListViewItem::width(fm, lv, c);
125 125
 }
126 126
 
127 127
 void ResultListViewText::setText(int column, const TQString &text)
128 128
 {
129 129
     if(!m_wasError && column == ResultColumn) {
130
-	KListViewItem::setText(column, m_value.toString());
130
+	TDEListViewItem::setText(column, m_value.toString());
131 131
 	return;
132 132
     }
133 133
 
134
-    KListViewItem::setText(column, text);
134
+    TDEListViewItem::setText(column, text);
135 135
 }

+ 4
- 4
src/resultlistviewtext.h View File

@@ -27,16 +27,16 @@ class TQColorGroup;
27 27
 class TQFontMetrics;
28 28
 
29 29
 // This class shows the results shown in the MainWindow result pane.
30
-class ResultListViewText : public KListViewItem
30
+class ResultListViewText : public TDEListViewItem
31 31
 {
32 32
     public:
33
-    ResultListViewText(KListView *listView,
33
+    ResultListViewText(TDEListView *listView,
34 34
                       const TQString &text,
35 35
 		      const TQString &result,
36 36
 		      ResultListViewText *after,
37 37
 		      bool isError = false);
38 38
 
39
-    ResultListViewText(KListView *listView,
39
+    ResultListViewText(TDEListView *listView,
40 40
                       const TQString &text,
41 41
 		      const Abakus::number_t &result,
42 42
 		      ResultListViewText *after,
@@ -53,7 +53,7 @@ class ResultListViewText : public KListViewItem
53 53
     // Redisplays the text by calling value.toString again.
54 54
     void precisionChanged();
55 55
 
56
-    // Reimplemented from KListViewItem
56
+    // Reimplemented from TDEListViewItem
57 57
     virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align);
58 58
     virtual int width(const TQFontMetrics &fm, const TQListView *lv, int c) const;
59 59
 

Loading…
Cancel
Save