From 9e5c87c89567a98c3344c90e392a27715437334c Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 15:14:58 -0600 Subject: Rename a number of classes to enhance compatibility with KDE4 --- kjots/KJotsMain.cpp | 56 +++++++++++++++++++++++++-------------------------- kjots/KJotsMain.h | 24 +++++++++++----------- kjots/confpagefont.ui | 2 +- kjots/kjotsedit.cpp | 2 +- kjots/kjotsedit.h | 4 ++-- kjots/kjotsentry.cpp | 18 ++++++++--------- kjots/kjotsentry.h | 10 ++++----- 7 files changed, 58 insertions(+), 58 deletions(-) (limited to 'kjots') diff --git a/kjots/KJotsMain.cpp b/kjots/KJotsMain.cpp index f674d7e..95fe7d7 100644 --- a/kjots/KJotsMain.cpp +++ b/kjots/KJotsMain.cpp @@ -56,7 +56,7 @@ extern KIconLoader* global_pix_loader; // KJOTSMAIN //---------------------------------------------------------------------- KJotsMain::KJotsMain(const char* name) - : KMainWindow(0,name), + : TDEMainWindow(0,name), currentEntry(0), invalidMoveFlag(false) { @@ -70,7 +70,7 @@ KJotsMain::KJotsMain(const char* name) splitter->setOpaqueResize( TDEGlobalSettings::opaqueResize() ); // the subject list - subjectList = new KListView(splitter, "subjectList"); + subjectList = new TDEListView(splitter, "subjectList"); subjectList->setRootIsDecorated(true); subjectList->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding)); subjectList->setMinimumWidth(subjectList->fontMetrics().maxWidth() * 10 + 5); @@ -104,42 +104,42 @@ KJotsMain::KJotsMain(const char* name) splitter->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding, 2, 1)); // create actions - actions[ACTION_NEXT_BOOK] = new KAction(i18n("Next Book"), TQString(), CTRL + Key_D, TQT_TQOBJECT(this), + actions[ACTION_NEXT_BOOK] = new TDEAction(i18n("Next Book"), TQString(), CTRL + Key_D, TQT_TQOBJECT(this), TQT_SLOT(nextBook()), actionCollection(), "go_next_book"); - actions[ACTION_PREV_BOOK] = new KAction(i18n("Previous Book"), TQString(), CTRL + SHIFT + Key_D, TQT_TQOBJECT(this), + actions[ACTION_PREV_BOOK] = new TDEAction(i18n("Previous Book"), TQString(), CTRL + SHIFT + Key_D, TQT_TQOBJECT(this), TQT_SLOT(prevBook()), actionCollection(), "go_prev_book"); - actions[ACTION_NEXT_PAGE] = new KAction(i18n("Next Page"), TQString(), CTRL + Key_PageDown, TQT_TQOBJECT(this), + actions[ACTION_NEXT_PAGE] = new TDEAction(i18n("Next Page"), TQString(), CTRL + Key_PageDown, TQT_TQOBJECT(this), TQT_SLOT(nextPage()), actionCollection(), "go_next_page"); - actions[ACTION_PREV_PAGE] = new KAction(i18n("Previous Page"), TQString(), CTRL + Key_PageUp, TQT_TQOBJECT(this), + actions[ACTION_PREV_PAGE] = new TDEAction(i18n("Previous Page"), TQString(), CTRL + Key_PageUp, TQT_TQOBJECT(this), TQT_SLOT(prevPage()), actionCollection(), "go_prev_page"); actions[ACTION_NEW_PAGE] = KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(newEntry()), actionCollection()); actions[ACTION_NEW_PAGE]->setText(i18n("&New Page")); - actions[ACTION_NEW_BOOK] = new KAction(i18n("New &Book..."), "contents", CTRL + SHIFT + Key_N, TQT_TQOBJECT(this), + actions[ACTION_NEW_BOOK] = new TDEAction(i18n("New &Book..."), "contents", CTRL + SHIFT + Key_N, TQT_TQOBJECT(this), TQT_SLOT(createNewBook()), actionCollection(), "new_book"); - exportPageMenu = new KActionMenu(i18n("Export Page"), actionCollection(), "save_page_to"); - actions[ACTION_PAGE2TEXT] = new KAction(i18n("To Text File..."), TQString(), 0, TQT_TQOBJECT(this), + exportPageMenu = new TDEActionMenu(i18n("Export Page"), actionCollection(), "save_page_to"); + actions[ACTION_PAGE2TEXT] = new TDEAction(i18n("To Text File..."), TQString(), 0, TQT_TQOBJECT(this), TQT_SLOT(writePage()), actionCollection(), "save_page_to_ascii"); actions[ACTION_PAGE2TEXT]->plug(exportPageMenu->popupMenu()); - actions[ACTION_PAGE2HTML] = new KAction(i18n("To HTML File..."), TQString(), 0, TQT_TQOBJECT(this), + actions[ACTION_PAGE2HTML] = new TDEAction(i18n("To HTML File..."), TQString(), 0, TQT_TQOBJECT(this), TQT_SLOT(writePageToHTML()), actionCollection(), "save_page_to_html"); actions[ACTION_PAGE2HTML]->plug(exportPageMenu->popupMenu()); - exportBookMenu = new KActionMenu(i18n("Export Book"), actionCollection(), "save_book_to"); - actions[ACTION_BOOK2TEXT] = new KAction(i18n("To Text File..."), TQString(), 0, TQT_TQOBJECT(this), + exportBookMenu = new TDEActionMenu(i18n("Export Book"), actionCollection(), "save_book_to"); + actions[ACTION_BOOK2TEXT] = new TDEAction(i18n("To Text File..."), TQString(), 0, TQT_TQOBJECT(this), TQT_SLOT(writeBook()), actionCollection(), "save_book_to_ascii"); actions[ACTION_BOOK2TEXT]->plug(exportBookMenu->popupMenu()); - actions[ACTION_BOOK2HTML] = new KAction(i18n("To HTML File..."), TQString(), 0, TQT_TQOBJECT(this), + actions[ACTION_BOOK2HTML] = new TDEAction(i18n("To HTML File..."), TQString(), 0, TQT_TQOBJECT(this), TQT_SLOT(writeBookToHTML()), actionCollection(), "save_book_to_html"); actions[ACTION_BOOK2HTML]->plug(exportBookMenu->popupMenu()); - actions[ACTION_DELETE_PAGE] = new KAction(i18n("&Delete Page"), "editdelete", CTRL + Key_Delete, TQT_TQOBJECT(this), + actions[ACTION_DELETE_PAGE] = new TDEAction(i18n("&Delete Page"), "editdelete", CTRL + Key_Delete, TQT_TQOBJECT(this), TQT_SLOT(deleteEntry()), actionCollection(), "del_page"); - actions[ACTION_DELETE_BOOK] = new KAction(i18n("Delete Boo&k"), "editdelete", CTRL + SHIFT + Key_Delete, TQT_TQOBJECT(this), + actions[ACTION_DELETE_BOOK] = new TDEAction(i18n("Delete Boo&k"), "editdelete", CTRL + SHIFT + Key_Delete, TQT_TQOBJECT(this), TQT_SLOT(deleteBook()), actionCollection(), "del_folder"); - actions[ACTION_MANUAL_SAVE] = new KAction(i18n("Manual Save"), 0, KStdAccel::save(), + actions[ACTION_MANUAL_SAVE] = new TDEAction(i18n("Manual Save"), 0, TDEStdAccel::save(), TQT_TQOBJECT(this), TQT_SLOT(autoSave()), actionCollection(), "manual_save"); actions[ACTION_PRINT] = KStdAction::print(TQT_TQOBJECT(this), TQT_SLOT(slotPrint()), actionCollection()); actions[ACTION_QUIT] = KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(slotQuit()), actionCollection()); @@ -150,7 +150,7 @@ KJotsMain::KJotsMain(const char* name) actions[ACTION_COPY] = KStdAction::copy(TQT_TQOBJECT(me_text), TQT_SLOT(copy()), actionCollection()); connect(me_text, TQT_SIGNAL(copyAvailable(bool)), actions[ACTION_COPY], TQT_SLOT(setEnabled(bool))); actions[ACTION_COPY]->setEnabled(false); - actions[ACTION_PASTE2TITLE] = new KAction(i18n("Copy &into Page Title"), "editcopy", CTRL+Key_T, TQT_TQOBJECT(this), + actions[ACTION_PASTE2TITLE] = new TDEAction(i18n("Copy &into Page Title"), "editcopy", CTRL+Key_T, TQT_TQOBJECT(this), TQT_SLOT(copySelection()), actionCollection(), "copyIntoTitle"); connect(me_text, TQT_SIGNAL(copyAvailable(bool)), actions[ACTION_PASTE2TITLE], TQT_SLOT(setEnabled(bool))); actions[ACTION_PASTE2TITLE]->setEnabled(false); @@ -161,14 +161,14 @@ KJotsMain::KJotsMain(const char* name) actions[ACTION_FIND_NEXT]->setEnabled(false); actions[ACTION_REPLACE] = KStdAction::replace( TQT_TQOBJECT(this), TQT_SLOT( slotReplace() ), actionCollection() ); - actions[ACTION_RENAME] = new KAction(i18n("Rename..."), TQString(), CTRL + Key_M, TQT_TQOBJECT(this), + actions[ACTION_RENAME] = new TDEAction(i18n("Rename..."), TQString(), CTRL + Key_M, TQT_TQOBJECT(this), TQT_SLOT(slotRenameEntry()), actionCollection(), "rename_entry"); - actions[ACTION_INSERT_DATE] = new KAction(i18n("Insert Date"), "date", CTRL + Key_I, TQT_TQOBJECT(this), + actions[ACTION_INSERT_DATE] = new TDEAction(i18n("Insert Date"), "date", CTRL + Key_I, TQT_TQOBJECT(this), TQT_SLOT(insertDate()), actionCollection(), "insert_date"); KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(configure()), actionCollection()); - bookmarkMenu = new KActionMenu(i18n("&Bookmarks"), "bookmarks", actionCollection(), "bookmarks"); + bookmarkMenu = new TDEActionMenu(i18n("&Bookmarks"), "bookmarks", actionCollection(), "bookmarks"); KJotsBookmarks* bookmarks = new KJotsBookmarks(this); connect(bookmarks, TQT_SIGNAL(openPage(const TQString&)), TQT_SLOT(jumpToBookmark(const TQString&))); new KBookmarkMenu(KBookmarkManager::managerForFile(locateLocal("appdata","bookmarks.xml")), @@ -177,7 +177,7 @@ KJotsMain::KJotsMain(const char* name) setupGUI(); /* * TODO: add a bookmark bar, something like this - KToolBar* bar = dynamic_cast(child("bookmarkToolBar", "KToolBar")); + TDEToolBar* bar = dynamic_cast(child("bookmarkToolBar", "TDEToolBar")); new KBookmarkBar(KBookmarkManager::managerForFile(locateLocal("appdata","bookmarks.xml")), bookmarks, bar, actionCollection(), this, "BookmarkBar"); if (bar->count() == 0) @@ -215,8 +215,8 @@ KJotsMain::KJotsMain(const char* name) this, TQT_SLOT(slotExpandBook(TQListViewItem*))); connect(subjectList, TQT_SIGNAL(collapsed(TQListViewItem*)), this, TQT_SLOT(slotCollapseBook(TQListViewItem*))); - connect(subjectList, TQT_SIGNAL(contextMenu(KListView*,TQListViewItem*,const TQPoint&)), - this, TQT_SLOT(showListviewContextMenu(KListView*,TQListViewItem*,const TQPoint&))); + connect(subjectList, TQT_SIGNAL(contextMenu(TDEListView*,TQListViewItem*,const TQPoint&)), + this, TQT_SLOT(showListviewContextMenu(TDEListView*,TQListViewItem*,const TQPoint&))); connect(subjectList, TQT_SIGNAL(itemRenamed(TQListViewItem*,const TQString&,int)), this, TQT_SLOT(slotItemRenamed(TQListViewItem*,const TQString&,int))); connect(roTextView, TQT_SIGNAL(urlClick(const TQString&)), @@ -654,10 +654,10 @@ void KJotsMain::slotFindSuccessful() actions[ACTION_FIND_NEXT]->setEnabled(true); } -void KJotsMain::showListviewContextMenu(KListView*, TQListViewItem* i, const TQPoint& p) +void KJotsMain::showListviewContextMenu(TDEListView*, TQListViewItem* i, const TQPoint& p) { if ( invalidMoveFlag ) return; //Prevent race condition - KActionMenu* am = new KActionMenu(TQT_TQOBJECT(this)); + TDEActionMenu* am = new TDEActionMenu(TQT_TQOBJECT(this)); if (!i) { @@ -670,7 +670,7 @@ void KJotsMain::showListviewContextMenu(KListView*, TQListViewItem* i, const TQP am->insert(actions[ACTION_NEW_PAGE]); am->insert(actions[ACTION_RENAME]); am->insert(exportBookMenu); - am->insert(new KActionSeparator(am)); + am->insert(new TDEActionSeparator(am)); am->insert(actions[ACTION_DELETE_BOOK]); } else @@ -679,7 +679,7 @@ void KJotsMain::showListviewContextMenu(KListView*, TQListViewItem* i, const TQP am->insert(actions[ACTION_NEW_PAGE]); am->insert(actions[ACTION_RENAME]); am->insert(exportPageMenu); - am->insert(new KActionSeparator(am)); + am->insert(new TDEActionSeparator(am)); am->insert(actions[ACTION_DELETE_PAGE]); } @@ -1173,7 +1173,7 @@ KJotsBook* KJotsMain::currentBook() { return dynamic_cast(e); } - e = dynamic_cast(e->KListViewItem::parent()); + e = dynamic_cast(e->TDEListViewItem::parent()); } return 0; diff --git a/kjots/KJotsMain.h b/kjots/KJotsMain.h index bc36d2d..565ab32 100644 --- a/kjots/KJotsMain.h +++ b/kjots/KJotsMain.h @@ -32,18 +32,18 @@ class TQGroupBox; class TQWidgetStack; class KTextBrowser; -class KAccel; +class TDEAccel; class KJotsMain; -class KToolBar; -class KListBox; -class KListView; -class KPopupMenu; +class TDEToolBar; +class TDEListBox; +class TDEListView; +class TDEPopupMenu; class ConfigureDialog; class KEdFind; class KEdReplace; class TQTimer; -class KAction; -class KActionMenu; +class TDEAction; +class TDEActionMenu; class KJotsPage; class KJotsBook; @@ -79,7 +79,7 @@ class KJotsEdit; #define ACTION_INSERT_DATE 23 #define ACTION_MAX 24 -class KJotsMain : public KMainWindow +class KJotsMain : public TDEMainWindow { Q_OBJECT @@ -131,7 +131,7 @@ class KJotsMain : public KMainWindow void prevPage(); // handling page changes in the listview - void showListviewContextMenu(KListView* l, TQListViewItem* i, const TQPoint& p); + void showListviewContextMenu(TDEListView* l, TQListViewItem* i, const TQPoint& p); void linkClicked(const TQString&); void autoSave(void); @@ -150,7 +150,7 @@ class KJotsMain : public KMainWindow TQButtonGroup *bg_top; KJotsEdit *me_text; KTextBrowser *roTextView; - KListView *subjectList; + TDEListView *subjectList; KJotsEntryBase *currentEntry; TQSplitter *splitter; TQWidgetStack *textStack; @@ -158,8 +158,8 @@ class KJotsMain : public KMainWindow TQTimer* m_autosaveTimer; bool invalidMoveFlag; //!< Used to fix a race condition. See Bug #109299 - KAction* actions[ACTION_MAX]; - KActionMenu *exportPageMenu, *exportBookMenu, *bookmarkMenu; + TDEAction* actions[ACTION_MAX]; + TDEActionMenu *exportPageMenu, *exportBookMenu, *bookmarkMenu; }; #endif // KJotsMain_included diff --git a/kjots/confpagefont.ui b/kjots/confpagefont.ui index d057ae0..c82914e 100644 --- a/kjots/confpagefont.ui +++ b/kjots/confpagefont.ui @@ -22,7 +22,7 @@ 0 - + kcfg_Font diff --git a/kjots/kjotsedit.cpp b/kjots/kjotsedit.cpp index 643fd92..f6be76f 100644 --- a/kjots/kjotsedit.cpp +++ b/kjots/kjotsedit.cpp @@ -44,7 +44,7 @@ KJotsEdit::KJotsEdit (TQWidget* parent, const char* name) setTextFormat(TQt::PlainText); setWordWrap(TQTextEdit::WidgetWidth); setLinkUnderline(true); - web_menu = new KPopupMenu(this);; + web_menu = new TDEPopupMenu(this);; web_menu->insertItem(i18n("Open URL"), this, TQT_SLOT(openUrl()) ); } diff --git a/kjots/kjotsedit.h b/kjots/kjotsedit.h index d5edf2a..a85d3d0 100644 --- a/kjots/kjotsedit.h +++ b/kjots/kjotsedit.h @@ -24,7 +24,7 @@ #define __KJOTSEDIT_H #include -class KPopupMenu; +class TDEPopupMenu; class KJotsPage; class KJotsEdit : public KEdit @@ -47,7 +47,7 @@ class KJotsEdit : public KEdit protected: virtual void mousePressEvent (TQMouseEvent *e); - KPopupMenu *web_menu; + TDEPopupMenu *web_menu; KJotsPage *m_entry; //!< The entry we are editing. It needs to be kept informed. }; diff --git a/kjots/kjotsentry.cpp b/kjots/kjotsentry.cpp index 35d6ddf..d1f94e2 100644 --- a/kjots/kjotsentry.cpp +++ b/kjots/kjotsentry.cpp @@ -69,16 +69,16 @@ TQString htmlFooter() // KJotsEntryBase // -KJotsEntryBase::KJotsEntryBase(KListView* parent, TQListViewItem* after=0) - :KListViewItem(parent,after) +KJotsEntryBase::KJotsEntryBase(TDEListView* parent, TQListViewItem* after=0) + :TDEListViewItem(parent,after) { m_id = 0; m_saveInProgress = m_dirty = false; m_parent = 0; } -KJotsEntryBase::KJotsEntryBase(KListViewItem* parent, TQListViewItem* after=0) - :KListViewItem(parent,after) +KJotsEntryBase::KJotsEntryBase(TDEListViewItem* parent, TQListViewItem* after=0) + :TDEListViewItem(parent,after) { m_id = 0; m_saveInProgress = m_dirty = false; @@ -93,9 +93,9 @@ void KJotsEntryBase::setSubject(const TQString& subj) void KJotsEntryBase::setText(int column, const TQString& text) { if (column == 0 && text.isEmpty()) - KListViewItem::setText(0, defaultSubject()); + TDEListViewItem::setText(0, defaultSubject()); else - KListViewItem::setText(column, text); + TDEListViewItem::setText(column, text); } /*! @@ -217,13 +217,13 @@ int KJotsEntryBase::printTitleBox(TQString title, KPrinter& printer, TQPainter& // KJotsBook // -KJotsBook::KJotsBook(KListView* parent, TQListViewItem* after) +KJotsBook::KJotsBook(TDEListView* parent, TQListViewItem* after) : KJotsEntryBase(parent, after) { init(); } -KJotsBook::KJotsBook(KListViewItem* parent, TQListViewItem* after) +KJotsBook::KJotsBook(TDEListViewItem* parent, TQListViewItem* after) : KJotsEntryBase(parent, after) { init(); @@ -982,7 +982,7 @@ void KJotsPage::slotSaveResult(TDEIO::Job *) void KJotsPage::print(TQFont& defaultFont) { - KJotsEntryBase* book = dynamic_cast(KListViewItem::parent()); + KJotsEntryBase* book = dynamic_cast(TDEListViewItem::parent()); TQString docName = book->subject(); if (!subject().isNull()) diff --git a/kjots/kjotsentry.h b/kjots/kjotsentry.h index a0260c8..d80a219 100644 --- a/kjots/kjotsentry.h +++ b/kjots/kjotsentry.h @@ -46,13 +46,13 @@ namespace TDEIO class Job; } -class KJotsEntryBase : public TQObject, public KListViewItem +class KJotsEntryBase : public TQObject, public TDEListViewItem { Q_OBJECT public: - KJotsEntryBase(KListView*, TQListViewItem*); - KJotsEntryBase(KListViewItem*, TQListViewItem*); + KJotsEntryBase(TDEListView*, TQListViewItem*); + KJotsEntryBase(TDEListViewItem*, TQListViewItem*); public: virtual void setSubject(const TQString&); @@ -101,8 +101,8 @@ class KJotsBook : public KJotsEntryBase Q_OBJECT public: - KJotsBook(KListView*, TQListViewItem* after = 0); - KJotsBook(KListViewItem*, TQListViewItem* after = 0); + KJotsBook(TDEListView*, TQListViewItem* after = 0); + KJotsBook(TDEListViewItem*, TQListViewItem* after = 0); ~KJotsBook(); static bool isBookFile(const TQString& book); -- cgit v1.2.1