summaryrefslogtreecommitdiffstats
path: root/kjots
diff options
context:
space:
mode:
Diffstat (limited to 'kjots')
-rw-r--r--kjots/CMakeLists.txt2
-rw-r--r--kjots/KJotsMain.cpp155
-rw-r--r--kjots/KJotsMain.h9
-rw-r--r--kjots/kjotsbookmarks.h2
-rw-r--r--kjots/kjotsedit.cpp487
-rw-r--r--kjots/kjotsedit.h61
-rw-r--r--kjots/kjotsentry.cpp34
-rw-r--r--kjots/kjotsentry.h6
-rw-r--r--kjots/main.cpp8
9 files changed, 633 insertions, 131 deletions
diff --git a/kjots/CMakeLists.txt b/kjots/CMakeLists.txt
index addcfed..c2ae2eb 100644
--- a/kjots/CMakeLists.txt
+++ b/kjots/CMakeLists.txt
@@ -31,7 +31,7 @@ tde_add_executable( kjots AUTOMOC
kjotsedit.cpp kjotsbookmarks.cpp
confpagefont.ui confpagemisc.ui
KJotsSettings.kcfgc
- LINK tdeprint-shared
+ LINK tdeprint-shared tdeutils-shared
DESTINATION ${BIN_INSTALL_DIR}
)
diff --git a/kjots/KJotsMain.cpp b/kjots/KJotsMain.cpp
index 5146536..9d3ca5c 100644
--- a/kjots/KJotsMain.cpp
+++ b/kjots/KJotsMain.cpp
@@ -36,7 +36,7 @@
#include <tdemessagebox.h>
#include <tdepopupmenu.h>
#include <krun.h>
-#include <kstandarddirs.h>
+#include <tdestandarddirs.h>
#include <tdestdaccel.h>
#include <ktextbrowser.h>
@@ -90,10 +90,9 @@ KJotsMain::KJotsMain(const char* name)
textStack = new TQWidgetStack(splitter);
me_text = new KJotsEdit(textStack, "me_text");
- me_text->setFocusPolicy(TQ_StrongFocus);
+ me_text->setFocusPolicy(TQWidget::StrongFocus);
me_text->setEnabled(false);
textStack->addWidget(me_text);
- connect(me_text, TQT_SIGNAL(findSuccessful()), this, TQT_SLOT(slotFindSuccessful()));
roTextView = new KTextBrowser(textStack, "roTextView", true);
textStack->addWidget(roTextView);
@@ -104,73 +103,73 @@ KJotsMain::KJotsMain(const char* name)
splitter->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding, 2, 1));
// create actions
- 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 TDEAction(i18n("Previous Book"), TQString(), CTRL + SHIFT + Key_D, TQT_TQOBJECT(this),
- TQT_SLOT(prevBook()), actionCollection(), "go_prev_book");
- 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 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_NEXT_BOOK] = new TDEAction(i18n("Next Book"), TQString(), CTRL + Key_D, this,
+ TQ_SLOT(nextBook()), actionCollection(), "go_next_book");
+ actions[ACTION_PREV_BOOK] = new TDEAction(i18n("Previous Book"), TQString(), CTRL + SHIFT + Key_D, this,
+ TQ_SLOT(prevBook()), actionCollection(), "go_prev_book");
+ actions[ACTION_NEXT_PAGE] = new TDEAction(i18n("Next Page"), TQString(), CTRL + Key_PageDown, this,
+ TQ_SLOT(nextPage()), actionCollection(), "go_next_page");
+ actions[ACTION_PREV_PAGE] = new TDEAction(i18n("Previous Page"), TQString(), CTRL + Key_PageUp, this,
+ TQ_SLOT(prevPage()), actionCollection(), "go_prev_page");
+
+ actions[ACTION_NEW_PAGE] = KStdAction::openNew(this, TQ_SLOT(newEntry()), actionCollection());
actions[ACTION_NEW_PAGE]->setText(i18n("&New Page"));
- actions[ACTION_NEW_BOOK] = new TDEAction(i18n("New &Book..."), "contents", CTRL + SHIFT + Key_N, TQT_TQOBJECT(this),
- TQT_SLOT(createNewBook()), actionCollection(), "new_book");
+ actions[ACTION_NEW_BOOK] = new TDEAction(i18n("New &Book..."), "contents", CTRL + SHIFT + Key_N, this,
+ TQ_SLOT(createNewBook()), actionCollection(), "new_book");
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] = new TDEAction(i18n("To Text File..."), TQString(), 0, this,
+ TQ_SLOT(writePage()), actionCollection(), "save_page_to_ascii");
actions[ACTION_PAGE2TEXT]->plug(exportPageMenu->popupMenu());
- 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] = new TDEAction(i18n("To HTML File..."), TQString(), 0, this,
+ TQ_SLOT(writePageToHTML()), actionCollection(), "save_page_to_html");
actions[ACTION_PAGE2HTML]->plug(exportPageMenu->popupMenu());
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] = new TDEAction(i18n("To Text File..."), TQString(), 0, this,
+ TQ_SLOT(writeBook()), actionCollection(), "save_book_to_ascii");
actions[ACTION_BOOK2TEXT]->plug(exportBookMenu->popupMenu());
- 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] = new TDEAction(i18n("To HTML File..."), TQString(), 0, this,
+ TQ_SLOT(writeBookToHTML()), actionCollection(), "save_book_to_html");
actions[ACTION_BOOK2HTML]->plug(exportBookMenu->popupMenu());
- actions[ACTION_DELETE_PAGE] = new TDEAction(i18n("&Delete Page"), "edit-delete", CTRL + Key_Delete, TQT_TQOBJECT(this),
- TQT_SLOT(deleteEntry()), actionCollection(), "del_page");
- actions[ACTION_DELETE_BOOK] = new TDEAction(i18n("Delete Boo&k"), "edit-delete", CTRL + SHIFT + Key_Delete, TQT_TQOBJECT(this),
- TQT_SLOT(deleteBook()), actionCollection(), "del_folder");
+ actions[ACTION_DELETE_PAGE] = new TDEAction(i18n("&Delete Page"), "edit-delete", CTRL + Key_Delete, this,
+ TQ_SLOT(deleteEntry()), actionCollection(), "del_page");
+ actions[ACTION_DELETE_BOOK] = new TDEAction(i18n("Delete Boo&k"), "edit-delete", CTRL + SHIFT + Key_Delete, this,
+ TQ_SLOT(deleteBook()), actionCollection(), "del_folder");
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());
+ this, TQ_SLOT(autoSave()), actionCollection(), "manual_save");
+ actions[ACTION_PRINT] = KStdAction::print(this, TQ_SLOT(slotPrint()), actionCollection());
+ actions[ACTION_QUIT] = KStdAction::quit(this, TQ_SLOT(slotQuit()), actionCollection());
- actions[ACTION_CUT] = KStdAction::cut(TQT_TQOBJECT(me_text), TQT_SLOT(cut()), actionCollection());
- connect(me_text, TQT_SIGNAL(copyAvailable(bool)), actions[ACTION_CUT], TQT_SLOT(setEnabled(bool)));
+ actions[ACTION_CUT] = KStdAction::cut(me_text, TQ_SLOT(cut()), actionCollection());
+ connect(me_text, TQ_SIGNAL(copyAvailable(bool)), actions[ACTION_CUT], TQ_SLOT(setEnabled(bool)));
actions[ACTION_CUT]->setEnabled(false);
- 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] = KStdAction::copy(me_text, TQ_SLOT(copy()), actionCollection());
+ connect(me_text, TQ_SIGNAL(copyAvailable(bool)), actions[ACTION_COPY], TQ_SLOT(setEnabled(bool)));
actions[ACTION_COPY]->setEnabled(false);
- actions[ACTION_PASTE2TITLE] = new TDEAction(i18n("Copy &into Page Title"), "edit-copy", 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] = new TDEAction(i18n("Copy &into Page Title"), "edit-copy", CTRL+Key_T, this,
+ TQ_SLOT(copySelection()), actionCollection(), "copyIntoTitle");
+ connect(me_text, TQ_SIGNAL(copyAvailable(bool)), actions[ACTION_PASTE2TITLE], TQ_SLOT(setEnabled(bool)));
actions[ACTION_PASTE2TITLE]->setEnabled(false);
- actions[ACTION_PASTE] = KStdAction::pasteText(TQT_TQOBJECT(me_text), TQT_SLOT(paste()), actionCollection());
+ actions[ACTION_PASTE] = KStdAction::pasteText(me_text, TQ_SLOT(paste()), actionCollection());
- actions[ACTION_FIND] = KStdAction::find( TQT_TQOBJECT(this), TQT_SLOT( slotSearch() ), actionCollection() );
- actions[ACTION_FIND_NEXT] = KStdAction::findNext( TQT_TQOBJECT(this), TQT_SLOT( slotRepeatSearch() ), actionCollection() );
- actions[ACTION_FIND_NEXT]->setEnabled(false);
- actions[ACTION_REPLACE] = KStdAction::replace( TQT_TQOBJECT(this), TQT_SLOT( slotReplace() ), actionCollection() );
+ actions[ACTION_FIND] = KStdAction::find(me_text, TQ_SLOT(find()), actionCollection());
+ actions[ACTION_FIND_NEXT] = KStdAction::findNext(me_text, TQ_SLOT(findNext()), actionCollection());
+ actions[ACTION_FIND_PREV] = KStdAction::findPrev(me_text, TQ_SLOT(findPrev()), actionCollection());
+ actions[ACTION_REPLACE] = KStdAction::replace(me_text, TQ_SLOT(replace()), actionCollection());
- 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 TDEAction(i18n("Insert Date"), "date", CTRL + Key_I, TQT_TQOBJECT(this),
- TQT_SLOT(insertDate()), actionCollection(), "insert_date");
+ actions[ACTION_RENAME] = new TDEAction(i18n("Rename..."), TQString(), CTRL + Key_M, this,
+ TQ_SLOT(slotRenameEntry()), actionCollection(), "rename_entry");
+ actions[ACTION_INSERT_DATE] = new TDEAction(i18n("Insert Date"), "date", CTRL + Key_I, this,
+ TQ_SLOT(insertDate()), actionCollection(), "insert_date");
- KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(configure()), actionCollection());
+ KStdAction::preferences(this, TQ_SLOT(configure()), actionCollection());
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&)));
+ connect(bookmarks, TQ_SIGNAL(openPage(const TQString&)), TQ_SLOT(jumpToBookmark(const TQString&)));
new KBookmarkMenu(KBookmarkManager::managerForFile(locateLocal("appdata","bookmarks.xml")),
bookmarks, bookmarkMenu->popupMenu(),
actionCollection(), true);
@@ -204,25 +203,25 @@ KJotsMain::KJotsMain(const char* name)
updateConfiguration();
updateMenu();
- TQTimer::singleShot(0, this, TQT_SLOT(slotSetupInterface()));
+ TQTimer::singleShot(0, this, TQ_SLOT(slotSetupInterface()));
//connect new slots
- connect(subjectList, TQT_SIGNAL(selectionChanged(TQListViewItem*)),
- this, TQT_SLOT(jumpToEntry(TQListViewItem*)));
- connect(subjectList, TQT_SIGNAL(moved(TQListViewItem*, TQListViewItem*, TQListViewItem*)),
- this, TQT_SLOT(slotItemMoved(TQListViewItem*, TQListViewItem*, TQListViewItem*)));
- connect(subjectList, TQT_SIGNAL(expanded(TQListViewItem*)),
- this, TQT_SLOT(slotExpandBook(TQListViewItem*)));
- connect(subjectList, TQT_SIGNAL(collapsed(TQListViewItem*)),
- this, TQT_SLOT(slotCollapseBook(TQListViewItem*)));
- 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&)),
- this, TQT_SLOT(linkClicked(const TQString&)));
- connect(m_autosaveTimer, TQT_SIGNAL(timeout()),
- this, TQT_SLOT(autoSave()));
+ connect(subjectList, TQ_SIGNAL(selectionChanged(TQListViewItem*)),
+ this, TQ_SLOT(jumpToEntry(TQListViewItem*)));
+ connect(subjectList, TQ_SIGNAL(moved(TQListViewItem*, TQListViewItem*, TQListViewItem*)),
+ this, TQ_SLOT(slotItemMoved(TQListViewItem*, TQListViewItem*, TQListViewItem*)));
+ connect(subjectList, TQ_SIGNAL(expanded(TQListViewItem*)),
+ this, TQ_SLOT(slotExpandBook(TQListViewItem*)));
+ connect(subjectList, TQ_SIGNAL(collapsed(TQListViewItem*)),
+ this, TQ_SLOT(slotCollapseBook(TQListViewItem*)));
+ connect(subjectList, TQ_SIGNAL(contextMenu(TDEListView*,TQListViewItem*,const TQPoint&)),
+ this, TQ_SLOT(showListviewContextMenu(TDEListView*,TQListViewItem*,const TQPoint&)));
+ connect(subjectList, TQ_SIGNAL(itemRenamed(TQListViewItem*,const TQString&,int)),
+ this, TQ_SLOT(slotItemRenamed(TQListViewItem*,const TQString&,int)));
+ connect(roTextView, TQ_SIGNAL(urlClick(const TQString&)),
+ this, TQ_SLOT(linkClicked(const TQString&)));
+ connect(m_autosaveTimer, TQ_SIGNAL(timeout()),
+ this, TQ_SLOT(autoSave()));
}
void KJotsMain::slotSetupInterface()
@@ -399,26 +398,11 @@ void KJotsMain::configure()
confPageMisc* cpMisc = new confPageMisc(0, "Autosave");
dialog->addPage(cpMisc, i18n("Autosave"), "misc");
- connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(updateConfiguration()));
+ connect(dialog, TQ_SIGNAL(settingsChanged()), this, TQ_SLOT(updateConfiguration()));
dialog->show();
}
-void KJotsMain::slotSearch()
-{
- me_text->search();
-}
-
-void KJotsMain::slotRepeatSearch()
-{
- me_text->repeatSearch();
-}
-
-void KJotsMain::slotReplace()
-{
- me_text->replace();
-}
-
void KJotsMain::updateConfiguration()
{
static int encoding = -1;
@@ -649,15 +633,10 @@ void KJotsMain::updateMenu()
}
}
-void KJotsMain::slotFindSuccessful()
-{
- actions[ACTION_FIND_NEXT]->setEnabled(true);
-}
-
void KJotsMain::showListviewContextMenu(TDEListView*, TQListViewItem* i, const TQPoint& p)
{
if ( invalidMoveFlag ) return; //Prevent race condition
- TDEActionMenu* am = new TDEActionMenu(TQT_TQOBJECT(this));
+ TDEActionMenu* am = new TDEActionMenu(this);
if (!i)
{
@@ -1053,7 +1032,7 @@ void KJotsMain::updateCaption()
}
}
- setCaption(kapp->makeStdCaption(caption));
+ setCaption(tdeApp->makeStdCaption(caption));
return;
}
diff --git a/kjots/KJotsMain.h b/kjots/KJotsMain.h
index 0f24e5a..ea38f08 100644
--- a/kjots/KJotsMain.h
+++ b/kjots/KJotsMain.h
@@ -77,11 +77,12 @@ class KJotsEdit;
#define ACTION_REPLACE 21
#define ACTION_RENAME 22
#define ACTION_INSERT_DATE 23
-#define ACTION_MAX 24
+#define ACTION_FIND_PREV 24
+#define ACTION_MAX 25
class KJotsMain : public TDEMainWindow
{
- Q_OBJECT
+ TQ_OBJECT
public:
@@ -106,11 +107,7 @@ class KJotsMain : public TDEMainWindow
void copySelection();
void insertDate();
void slotPrint();
- void slotSearch();
- void slotRepeatSearch();
- void slotReplace();
void slotQuit();
- void slotFindSuccessful();
void jumpToEntry(TQListViewItem* entry, bool=false);
diff --git a/kjots/kjotsbookmarks.h b/kjots/kjotsbookmarks.h
index ebf08d4..c71c15f 100644
--- a/kjots/kjotsbookmarks.h
+++ b/kjots/kjotsbookmarks.h
@@ -29,7 +29,7 @@ class KJotsMain;
class KJotsBookmarks : public TQObject, public KBookmarkOwner
{
- Q_OBJECT
+ TQ_OBJECT
public:
diff --git a/kjots/kjotsedit.cpp b/kjots/kjotsedit.cpp
index 420f715..b2ffe89 100644
--- a/kjots/kjotsedit.cpp
+++ b/kjots/kjotsedit.cpp
@@ -25,8 +25,13 @@
#include <tqcursor.h>
#include <tdepopupmenu.h>
-#include <keditcl.h>
+#include <kfind.h>
+#include <kfinddialog.h>
+#include <kreplace.h>
+#include <kreplacedialog.h>
+#include <kstringhandler.h>
#include <tdelocale.h>
+#include <tdemessagebox.h>
#include <kopenwith.h>
#include <kprinter.h>
@@ -37,25 +42,30 @@
// MYMULTIEDIT
//----------------------------------------------------------------------
KJotsEdit::KJotsEdit (TQWidget* parent, const char* name)
- : KEdit(parent, name),
- m_entry(0)
+ : KTextEdit(parent, name)
+ , m_entry(nullptr)
+ , m_find(nullptr)
+ , m_findDialog(nullptr)
+ , m_replace(nullptr)
+ , m_replaceDialog(nullptr)
{
// no rich text until printing and other such issues are worked out
setTextFormat(TQt::PlainText);
setWordWrap(TQTextEdit::WidgetWidth);
setLinkUnderline(true);
web_menu = new TDEPopupMenu(this);;
- web_menu->insertItem(i18n("Open URL"), this, TQT_SLOT(openUrl()) );
+ web_menu->insertItem(i18n("Open URL"), this, TQ_SLOT(openUrl()) );
}
KJotsEdit::~KJotsEdit()
{
-
+ delete m_find;
+ delete m_replace;
}
void KJotsEdit::mousePressEvent( TQMouseEvent *e )
{
- if(e->button() == Qt::RightButton &&
+ if(e->button() == TQt::RightButton &&
hasSelectedText())
{
KURL url(selectedText());
@@ -67,7 +77,7 @@ void KJotsEdit::mousePressEvent( TQMouseEvent *e )
}
}
- KEdit::mousePressEvent(e);
+ KTextEdit::mousePressEvent(e);
}
void KJotsEdit::openUrl()
@@ -121,6 +131,441 @@ void KJotsEdit::print(TQString title)
}
}
+void KJotsEdit::slotFindHighlight(const TQString& text, int matchIndex, int matchLength)
+{
+ // tqDebug("KJotsEdit::slotFindHighlight");
+
+ Q_UNUSED(text);
+
+ const bool inSelection = m_find->options() & KFindDialog::SelectedText;
+
+ // Ensure we are offsetting the selection for the first line of the selection
+ // so we don't highlight the wrong text.
+ if (inSelection && (m_findCursor.paragraph == m_selectionStart.paragraph))
+ {
+ setSelection(m_findCursor.paragraph, m_selectionStart.paragraphIndex + matchIndex, m_findCursor.paragraph,
+ m_selectionStart.paragraphIndex + matchIndex + matchLength);
+ }
+ else
+ {
+ setSelection(m_findCursor.paragraph, matchIndex, m_findCursor.paragraph, matchIndex + matchLength);
+ }
+}
+
+void KJotsEdit::slotReplaceHighlight(const TQString& text, int matchIndex, int matchLength)
+{
+ // tqDebug("KJotsEdit::slotReplaceHighlight");
+
+ Q_UNUSED(text);
+
+ setSelection(m_replaceCursor.paragraph, matchIndex, m_replaceCursor.paragraph, matchIndex + matchLength);
+}
+
+void KJotsEdit::replace()
+{
+ // tqDebug("KJotsEdit::replace");
+
+ if (length() == 0)
+ {
+ return;
+ }
+
+ if (m_replaceDialog)
+ {
+ m_replaceDialog->setActiveWindow();
+ }
+ else
+ {
+ m_replaceDialog = new KReplaceDialog(this, "m_replaceDialog", KReplaceDialog::PromptOnReplace);
+ connect(m_replaceDialog, TQ_SIGNAL(okClicked()), this, TQ_SLOT(slotDoReplace()));
+ }
+
+ if (hasSelectedText())
+ {
+ m_replaceDialog->setHasSelection(true);
+ m_replaceDialog->setOptions(m_replaceDialog->options() | KReplaceDialog::SelectedText);
+ }
+ else
+ {
+ m_replaceDialog->setHasSelection(false);
+ m_replaceDialog->setOptions(m_replaceDialog->options() & ~KReplaceDialog::SelectedText);
+ }
+
+ m_replaceDialog->show();
+}
+
+void KJotsEdit::slotDoReplace()
+{
+ // tqDebug("KJotsEdit::slotDoReplace");
+
+ /* Performing a new replacement, so we need to remove the previous
+ * KReplace, set up a new one and the 'replaceNext' functionality. */
+
+ delete m_replace;
+ m_replace = nullptr;
+
+ if (!m_replaceDialog)
+ {
+ // tqDebug("KJotsEdit::slotDoReplace: no replaceDialog");
+ return;
+ }
+
+ m_replace = new KReplace(m_replaceDialog->pattern(), m_replaceDialog->replacement(), m_replaceDialog->options());
+
+ if ((m_replace->options() & KReplaceDialog::SelectedText))
+ {
+ const bool backwards = m_replace->options() & KFindDialog::FindBackwards;
+
+ getSelection(&m_selectionStart.paragraph, &m_selectionStart.paragraphIndex, &m_selectionEnd.paragraph,
+ &m_selectionEnd.paragraphIndex);
+ m_replaceCursor.paragraph = backwards ? m_selectionEnd.paragraph : m_selectionStart.paragraph;
+ m_replaceCursor.paragraphIndex = backwards ? m_selectionEnd.paragraphIndex : m_selectionStart.paragraphIndex;
+ }
+ else
+ {
+ setupCursor(&m_replaceCursor, m_replace);
+ }
+
+ connect(m_replace, TQ_SIGNAL(highlight(const TQString&, int, int)), this,
+ TQ_SLOT(slotReplaceHighlight(const TQString&, int, int)));
+ connect(m_replace, TQ_SIGNAL(findNext()), this, TQ_SLOT(slotReplaceNext()));
+ connect(m_replace, TQ_SIGNAL(replace(const TQString&, int, int, int)), this,
+ TQ_SLOT(slotReplace(const TQString&, int, int, int)));
+
+ m_replaceDialog->close();
+ slotReplaceNext();
+}
+
+void KJotsEdit::slotReplace(const TQString& replaceText, int replacementIndex, int replacementLength, int matchedLength)
+{
+ // tqDebug("KJotsEdit::slotReplace");
+
+ // Ensure the selection only matches the replacement.
+ // Prevents an issue where all the text is selected before replacing (since we remove the selection below).
+ setSelection(m_replaceCursor.paragraph, replacementIndex, m_replaceCursor.paragraph,
+ replacementIndex + matchedLength);
+
+ const auto replacement = replaceText.mid(replacementIndex, replacementLength);
+ removeSelectedText();
+ insertAt(replacement, m_replaceCursor.paragraph, replacementIndex);
+ setModified(true);
+}
+
+void KJotsEdit::slotReplaceNext()
+{
+ // tqDebug("KJotsEdit::slotReplaceNext");
+
+ if (!m_replace)
+ {
+ return;
+ }
+
+ const bool backwards = (m_replace->options() & KReplaceDialog::FindBackwards);
+ const bool useSelection = (m_replace->options() & KReplaceDialog::SelectedText);
+
+ if (m_replace->needData())
+ {
+ if (useSelection && backwards)
+ {
+ m_replace->setData(text(m_selectionEnd.paragraph), m_selectionEnd.paragraphIndex);
+ }
+ else if (useSelection)
+ {
+ m_replace->setData(text(m_selectionStart.paragraph), m_selectionStart.paragraphIndex);
+ }
+ else
+ {
+ m_replace->setData(text(m_replaceCursor.paragraph), m_replaceCursor.paragraphIndex);
+ }
+ }
+
+ KReplace::Result res = KReplace::NoMatch;
+
+ do
+ {
+ res = m_replace->replace();
+ if (res == KReplace::Match)
+ {
+ return;
+ }
+
+ m_replaceCursor.paragraph += (backwards ? -1 : 1);
+ m_replaceCursor.paragraphIndex = (backwards ? paragraphLength(m_replaceCursor.paragraph) : 0);
+ m_replace->setData(text(m_replaceCursor.paragraph), m_replaceCursor.paragraphIndex);
+
+ if (useSelection && m_replaceCursor.paragraph > m_selectionEnd.paragraph)
+ {
+ break;
+ }
+
+ if (useSelection && backwards && m_replaceCursor.paragraph < m_selectionStart.paragraph)
+ {
+ break;
+ }
+ } while (backwards ? (m_replaceCursor.paragraph >= 0) : (m_replaceCursor.paragraph < paragraphs()));
+
+ Q_ASSERT(res != KReplace::Match);
+
+ if ((m_replace->options() & KReplaceDialog::FromCursor) && m_replace->shouldRestart(true))
+ {
+ // tqDebug("KJotsEdit::slotReplaceNext restarting");
+ m_replaceCursor.paragraph = backwards ? (paragraphs() - 1) : 0;
+ m_replaceCursor.paragraphIndex = backwards ? (paragraphLength(m_replaceCursor.paragraph)) : 0;
+ m_replace->setData(text(m_replaceCursor.paragraph), m_replaceCursor.paragraphIndex);
+ m_replace->resetCounts();
+ slotReplaceNext();
+ return;
+ }
+
+ m_replace->displayFinalDialog();
+ m_replace->disconnect(this, TQ_SLOT(slotReplaceHighlight(const TQString&, int, int)));
+ m_replace->deleteLater();
+ m_replace = nullptr;
+}
+
+void KJotsEdit::find()
+{
+ // tqDebug("KJotsEdit::find");
+
+ if (length() == 0)
+ {
+ return;
+ }
+
+ if (m_findDialog)
+ {
+ m_findDialog->setActiveWindow();
+ }
+ else
+ {
+ m_findDialog = new KFindDialog(this, "m_findDialog");
+ connect(m_findDialog, TQ_SIGNAL(okClicked()), this, TQ_SLOT(slotDoFind()));
+ }
+
+ if (hasSelectedText())
+ {
+ m_findDialog->setHasSelection(true);
+ m_findDialog->setOptions(m_findDialog->options() | KFindDialog::SelectedText);
+ }
+ else
+ {
+ m_findDialog->setHasSelection(false);
+ m_findDialog->setOptions(m_findDialog->options() & ~KFindDialog::SelectedText);
+ }
+
+
+ m_findDialog->show();
+}
+
+void KJotsEdit::findNext()
+{
+ // tqDebug("KJotsEdit::findNext");
+
+ if (!m_find)
+ {
+ find();
+ return;
+ }
+
+ const bool backwards = (m_find->options() & KFindDialog::FindBackwards);
+ const bool fromCursor = (m_find->options() & KFindDialog::FromCursor);
+ const bool inSelection = (m_find->options() & KFindDialog::SelectedText);
+
+ if (m_find->needData())
+ {
+ if (inSelection)
+ {
+ if (m_selectionStart.paragraph == m_selectionEnd.paragraph)
+ {
+ // Same line, ensure we only inlcude the selection.
+ auto selectionLength = m_selectionEnd.paragraphIndex - m_selectionStart.paragraphIndex;
+ auto data = text(m_findCursor.paragraph).mid(m_selectionStart.paragraphIndex, selectionLength);
+ m_find->setData(data);
+ }
+ else if (backwards)
+ {
+ m_findCursor.paragraph = m_selectionEnd.paragraph;
+ m_findCursor.paragraphIndex = -1;
+ m_find->setData(text(m_findCursor.paragraph).left(m_selectionEnd.paragraphIndex));
+ }
+ else
+ {
+ m_findCursor.paragraph = m_selectionStart.paragraph;
+ m_findCursor.paragraphIndex = 0;
+ auto offset = (paragraphLength(m_findCursor.paragraph)) - m_selectionStart.paragraphIndex+1;
+ m_find->setData(text(m_findCursor.paragraph).right(offset), m_findCursor.paragraphIndex);
+ }
+ }
+ else
+ {
+ m_find->setData(text(m_findCursor.paragraph), m_findCursor.paragraphIndex);
+ }
+ }
+
+ KFind::Result res = KFind::NoMatch;
+
+ do
+ {
+ res = m_find->find();
+ if (res == KFind::Match)
+ {
+ return;
+ }
+
+ m_findCursor.paragraph += (backwards ? -1 : 1);
+ m_findCursor.paragraphIndex = -1; // SOL or EOL depending on `backwards`.
+
+ if (m_findCursor.paragraph == m_selectionStart.paragraph)
+ {
+ auto offset = (paragraphLength(m_findCursor.paragraph)) - m_selectionStart.paragraphIndex+1;
+ m_find->setData(text(m_findCursor.paragraph).right(offset), m_findCursor.paragraphIndex);
+ }
+ else if (m_findCursor.paragraph == m_selectionEnd.paragraph)
+ {
+ m_find->setData(text(m_findCursor.paragraph).left(m_selectionEnd.paragraphIndex), m_findCursor.paragraphIndex);
+ }
+ else
+ {
+ m_findCursor.paragraphIndex = -1;
+ m_find->setData(text(m_findCursor.paragraph), m_findCursor.paragraphIndex);
+ }
+
+ if (inSelection && backwards && m_findCursor.paragraph < m_selectionStart.paragraph)
+ {
+ break;
+ }
+
+ if (inSelection && m_findCursor.paragraph > m_selectionEnd.paragraph)
+ {
+ break;
+ }
+ } while (backwards ? (m_findCursor.paragraph >= 0) : (m_findCursor.paragraph < paragraphs()));
+
+ Q_ASSERT(res != KFind::Match);
+
+ // If there were no matches, and we were checking from the start of the text,
+ // then we do not want to prompt to search again, since we already know there
+ // is nothing.
+
+ if (m_find->numMatches() == 0 && !fromCursor)
+ {
+ KMessageBox::sorry(this,
+ i18n("Search string '%1' was not found!").arg(KStringHandler::csqueeze(m_find->pattern())));
+ // Reset the cursor in case more text is added between calls to findNext()
+ m_findCursor = m_selectionStart;
+ m_find->setData(text(m_selectionStart.paragraph)
+ .mid(m_selectionStart.paragraphIndex,
+ m_selectionEnd.paragraphIndex - m_selectionStart.paragraphIndex));
+ return;
+ }
+
+ if (m_find->shouldRestart(/* forceAsking */ true, /* showNumMatches */ false))
+ {
+ if (inSelection)
+ {
+ if (m_selectionStart.paragraph == m_selectionEnd.paragraph)
+ {
+ m_findCursor.paragraph = m_selectionStart.paragraph;
+ m_findCursor.paragraphIndex = m_selectionStart.paragraphIndex;
+ auto selectionLength = m_selectionEnd.paragraphIndex - m_selectionStart.paragraphIndex;
+ auto data = text(m_findCursor.paragraph).mid(m_findCursor.paragraphIndex, selectionLength);
+ m_find->setData(data);
+ }
+ else if (backwards)
+ {
+ m_findCursor = m_selectionEnd;
+ m_find->setData(text(m_findCursor.paragraph).left(m_findCursor.paragraphIndex));
+ }
+ else
+ {
+ m_findCursor.paragraph = m_selectionStart.paragraph;
+ m_findCursor.paragraphIndex = -1;
+ auto offset = (paragraphLength(m_findCursor.paragraph)) - m_selectionStart.paragraphIndex+1;
+ m_find->setData(text(m_findCursor.paragraph).right(offset), m_findCursor.paragraphIndex);
+ }
+ }
+ else
+ {
+ m_findCursor.paragraph = backwards ? (paragraphs() - 1) : 0;
+ m_findCursor.paragraphIndex = backwards ? (paragraphLength(m_findCursor.paragraph)) : 0;
+ m_find->setData(text(m_findCursor.paragraph), m_findCursor.paragraphIndex);
+ }
+
+ m_find->resetCounts();
+ findNext();
+ }
+}
+
+void KJotsEdit::findPrev()
+{
+ if (!m_find)
+ {
+ find();
+ return;
+ }
+
+ m_find->setOptions(m_find->options() ^ KFindDialog::FindBackwards);
+ findNext();
+
+ // Check as pressing 'stop' will delete m_find.
+ if (m_find)
+ {
+ m_find->setOptions(m_find->options() ^ KFindDialog::FindBackwards);
+ }
+}
+
+void KJotsEdit::slotDoFind()
+{
+ // tqDebug("KJotsEdit::slotDoFind");
+
+ /* Performing a new search, ensure the previous search is invalidated. */
+
+ delete m_find;
+ m_find = nullptr;
+
+ if (!m_findDialog)
+ {
+ // tqDebug("KJotsEdit::slotDoFind: find dialog not set up");
+ return;
+ }
+
+ if (m_findDialog->pattern().isEmpty())
+ {
+ // tqDebug("KJotsEdit::slotDoFind: empty pattern.");
+ return;
+ }
+
+ // tqDebug("findDialog->pattern = %s", m_findDialog->pattern().local8Bit().data());
+
+ m_find = new KFind(m_findDialog->pattern(), m_findDialog->options(), this);
+
+ if (m_find->options() & KFindDialog::SelectedText)
+ {
+ const bool backwards = m_find->options() & KFindDialog::FindBackwards;
+
+ getSelection(&m_selectionStart.paragraph, &m_selectionStart.paragraphIndex, &m_selectionEnd.paragraph,
+ &m_selectionEnd.paragraphIndex);
+ m_findCursor.paragraph = backwards ? m_selectionEnd.paragraph : m_selectionStart.paragraph;
+ m_findCursor.paragraphIndex = backwards ? m_selectionEnd.paragraphIndex : m_selectionStart.paragraphIndex;
+ }
+ else
+ {
+ setupCursor(&m_findCursor, m_find);
+ // Reset selection so slotFindHighlight works correctly.
+ m_selectionStart = {0, 0};
+ m_selectionEnd = {0, 0};
+ }
+
+ connect(m_find, TQ_SIGNAL(highlight(const TQString&, int, int)), this,
+ TQ_SLOT(slotFindHighlight(const TQString&, int, int)));
+ connect(m_find, TQ_SIGNAL(findNext()), this, TQ_SLOT(findNext()));
+
+ m_findDialog->close();
+ m_find->closeFindNextDialog();
+
+ findNext();
+}
+
void KJotsEdit::setEntry (KJotsPage *entry)
{
//tell the old entry to take a hike
@@ -144,6 +589,34 @@ void KJotsEdit::setEntry (KJotsPage *entry)
}
m_entry = entry;
+
+ // Reset the find & replace dialog for the new entry.
+ delete m_find;
+ delete m_replace;
+ m_find = nullptr;
+ m_replace = nullptr;
+}
+
+void KJotsEdit::setupCursor(KJotsEdit::CursorPosition* cursor, const KFind* find)
+{
+ if (!cursor)
+ {
+ tqWarning("WARNING: Attempting to setup a NULL cursor: %s (%d)", __FILE__, __LINE__);
+ return;
+ }
+
+ cursor->paragraph = 0;
+ cursor->paragraphIndex = 0;
+
+ if (find->options() & KFindDialog::FromCursor)
+ {
+ getCursorPosition(&cursor->paragraph, &cursor->paragraphIndex);
+ }
+ else if (find->options() & KFindDialog::FindBackwards)
+ {
+ cursor->paragraph = paragraphs();
+ cursor->paragraphIndex = paragraphLength(cursor->paragraph);
+ }
}
#include "kjotsedit.moc"
diff --git a/kjots/kjotsedit.h b/kjots/kjotsedit.h
index a85d3d0..75012f8 100644
--- a/kjots/kjotsedit.h
+++ b/kjots/kjotsedit.h
@@ -23,13 +23,18 @@
#ifndef __KJOTSEDIT_H
#define __KJOTSEDIT_H
-#include <keditcl.h>
+#include <ktextedit.h>
+
+class KFind;
+class KFindDialog;
+class KReplace;
+class KReplaceDialog;
class TDEPopupMenu;
class KJotsPage;
-class KJotsEdit : public KEdit
+class KJotsEdit : public KTextEdit
{
- Q_OBJECT
+ TQ_OBJECT
public:
KJotsEdit (TQWidget* parent=0, const char* name=0);
@@ -41,14 +46,62 @@ class KJotsEdit : public KEdit
signals:
void findSuccessful();
+ public slots:
+ // Create the initial KFindDialog.
+ void find();
+ // Repeat the previous search.
+ // Creates KFindDialog if needed.
+ void findNext();
+ // Repeat the previous search, but in the opposite direction.
+ // Creates KFindDialog if needed.
+ void findPrev();
+ // Creates a KReplaceDialog
+ void replace();
+
protected slots:
- void openUrl();
+ void openUrl();
+ void slotFindHighlight(const TQString&, int, int);
+ void slotReplaceHighlight(const TQString&, int, int);
+ void slotDoFind();
+ void slotDoReplace();
+ void slotReplace(const TQString&, int, int, int);
+ void slotReplaceNext();
protected:
virtual void mousePressEvent (TQMouseEvent *e);
TDEPopupMenu *web_menu;
KJotsPage *m_entry; //!< The entry we are editing. It needs to be kept informed.
+
+ private:
+
+ /*
+ * Keep track of the current cursor position for find/replace
+ * functionality, allowing us to increment easily.
+ */
+ struct CursorPosition
+ {
+ // Current paragraph.
+ int paragraph;
+ // Index from start of current paragraph.
+ int paragraphIndex;
+ };
+
+ KFind *m_find;
+ KFindDialog *m_findDialog;
+ KReplace *m_replace;
+ KReplaceDialog *m_replaceDialog;
+
+ // Maintaining two positions to allow replace while find still active.
+ CursorPosition m_findCursor{0, 0};
+ CursorPosition m_replaceCursor{0, 0};
+
+ // Start and end position of selection, used to restart search with initial selection.
+ CursorPosition m_selectionStart{0, 0};
+ CursorPosition m_selectionEnd{0, 0};
+
+ // Setup for m_findCursor/m_replaceCursor with m_find/m_replace
+ void setupCursor(CursorPosition*, const KFind*);
};
#endif // __KJOTSEDIT_H
diff --git a/kjots/kjotsentry.cpp b/kjots/kjotsentry.cpp
index 03581cf..c947f94 100644
--- a/kjots/kjotsentry.cpp
+++ b/kjots/kjotsentry.cpp
@@ -32,7 +32,7 @@
#include <tdelocale.h>
#include <tdemessagebox.h>
#include <kprogress.h>
-#include <kstandarddirs.h>
+#include <tdestandarddirs.h>
#include <tdetempfile.h>
#include <tdeio/job.h>
@@ -245,7 +245,7 @@ void KJotsBook::init()
m_open = false;
m_saveProgressDialog = 0;
setExpandable(true);
- setPixmap(0, kapp->iconLoader()->loadIcon(TQString("contents"),TDEIcon::Small));
+ setPixmap(0, tdeApp->iconLoader()->loadIcon(TQString("contents"),TDEIcon::Small));
}
/*!
@@ -264,7 +264,7 @@ bool KJotsBook::isBookFile(const TQString& filename)
{
if ( folder.open(IO_ReadWrite) )
{
- TQTextStream st(TQT_TQIODEVICE(&folder));
+ TQTextStream st(&folder);
st.setEncoding( KJotsSettings::unicode() ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale );
TQString buf = st.readLine().stripWhiteSpace();
@@ -306,7 +306,7 @@ bool KJotsBook::openBook(const TQString& filename)
if ( file.exists() && file.open(IO_ReadWrite) ) //TODO: Implement read-only mode?
{
- TQTextStream st(TQT_TQIODEVICE(&file));
+ TQTextStream st(&file);
st.setEncoding( KJotsSettings::unicode() ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale );
TQString data = st.read();
@@ -388,7 +388,7 @@ bool KJotsBook::openBook(const TQString& filename)
*/
bool KJotsBook::loadOldBook(TQFile &file)
{
- TQTextStream st(TQT_TQIODEVICE(&file));
+ TQTextStream st(&file);
st.setEncoding( KJotsSettings::unicode() ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale );
TQString buf = st.readLine();
@@ -501,7 +501,7 @@ void KJotsBook::rename()
{
setSubject(name);
- KJotsMain* m = dynamic_cast<KJotsMain*>(kapp->mainWidget());
+ KJotsMain* m = dynamic_cast<KJotsMain*>(tdeApp->mainWidget());
if (m)
m->updateCaption();
@@ -541,8 +541,8 @@ void KJotsBook::saveToFile(KURL url, bool plainText, const TQString& encoding)
m_saveProgressDialog->showCancelButton(false);
m_saveProgressDialog->setAutoClose(true);
- connect(job, TQT_SIGNAL(dataReq(TDEIO::Job*, TQByteArray&)), TQT_SLOT(saveDataReq(TDEIO::Job*, TQByteArray&)));
- connect(job, TQT_SIGNAL(result( TDEIO::Job *)), TQT_SLOT(slotSaveResult( TDEIO::Job *)));
+ connect(job, TQ_SIGNAL(dataReq(TDEIO::Job*, TQByteArray&)), TQ_SLOT(saveDataReq(TDEIO::Job*, TQByteArray&)));
+ connect(job, TQ_SIGNAL(result( TDEIO::Job *)), TQ_SLOT(slotSaveResult( TDEIO::Job *)));
m_saveInProgress = true;
}
@@ -849,7 +849,7 @@ KJotsPage::KJotsPage(KJotsBook* parent, TQListViewItem *after)
{
m_isBook = false;
m_paraPos = m_indexPos = 0;
- setPixmap(0, kapp->iconLoader()->loadIcon(TQString("edit"), TDEIcon::Small));
+ setPixmap(0, tdeApp->iconLoader()->loadIcon(TQString("edit"), TDEIcon::Small));
}
KJotsPage::~KJotsPage()
@@ -882,10 +882,10 @@ void KJotsPage::initNewPage(void)
TQString KJotsPage::body()
{
//if we're being edited we want the current text, not whatever we saved before.
- if ( m_editor && m_editor->edited() )
+ if (m_editor && m_editor->isModified())
{
m_text = m_editor->text();
- m_editor->setEdited(false);
+ m_editor->setModified(false);
setDirty(true);
}
@@ -913,7 +913,7 @@ void KJotsPage::rename()
{
setSubject(name);
- KJotsMain* m = dynamic_cast<KJotsMain*>(kapp->mainWidget());
+ KJotsMain* m = dynamic_cast<KJotsMain*>(tdeApp->mainWidget());
if (m)
m->updateCaption();
@@ -939,8 +939,8 @@ void KJotsPage::saveToFile(KURL url, bool plainText, const TQString& encoding)
return;
}
- connect(job, TQT_SIGNAL(dataReq(TDEIO::Job*, TQByteArray&)), TQT_SLOT(saveDataReq(TDEIO::Job*, TQByteArray&)));
- connect(job, TQT_SIGNAL(result( TDEIO::Job *)), TQT_SLOT(slotSaveResult( TDEIO::Job *)));
+ connect(job, TQ_SIGNAL(dataReq(TDEIO::Job*, TQByteArray&)), TQ_SLOT(saveDataReq(TDEIO::Job*, TQByteArray&)));
+ connect(job, TQ_SIGNAL(result( TDEIO::Job *)), TQ_SLOT(slotSaveResult( TDEIO::Job *)));
m_saveInProgress = true;
}
@@ -1079,7 +1079,7 @@ void KJotsPage::setEditor( KJotsEdit *editor )
{
m_editor->getCursorPosition(&m_paraPos, &m_indexPos);
- if ( m_editor->edited() )
+ if (m_editor->isModified())
{
m_text = m_editor->text();
setDirty(true);
@@ -1091,7 +1091,7 @@ void KJotsPage::setEditor( KJotsEdit *editor )
//and in with the new
if ( m_editor )
{
- m_editor->setEdited(false);
+ m_editor->setModified(false);
m_editor->setCursorPosition(m_paraPos, m_indexPos);
}
@@ -1105,7 +1105,7 @@ void KJotsPage::setEditor( KJotsEdit *editor )
*/
bool KJotsPage::isDirty()
{
- if ( m_editor && m_editor->edited() )
+ if (m_editor && m_editor->isModified())
{
setDirty(true);
}
diff --git a/kjots/kjotsentry.h b/kjots/kjotsentry.h
index 45c165d..1f1adc5 100644
--- a/kjots/kjotsentry.h
+++ b/kjots/kjotsentry.h
@@ -48,7 +48,7 @@ namespace TDEIO
class KJotsEntryBase : public TQObject, public TDEListViewItem
{
- Q_OBJECT
+ TQ_OBJECT
public:
KJotsEntryBase(TDEListView*, TQListViewItem*);
@@ -98,7 +98,7 @@ class KJotsEntryBase : public TQObject, public TDEListViewItem
class KJotsBook : public KJotsEntryBase
{
- Q_OBJECT
+ TQ_OBJECT
public:
KJotsBook(TDEListView*, TQListViewItem* after = 0);
@@ -142,7 +142,7 @@ class KJotsBook : public KJotsEntryBase
//
class KJotsPage : public KJotsEntryBase
{
- Q_OBJECT
+ TQ_OBJECT
public:
KJotsPage(KJotsBook* parent, TQListViewItem* after = 0);
diff --git a/kjots/main.cpp b/kjots/main.cpp
index 48c55fa..343675a 100644
--- a/kjots/main.cpp
+++ b/kjots/main.cpp
@@ -24,7 +24,7 @@
#endif
#include <stdlib.h>
-#include <kuniqueapplication.h>
+#include <tdeuniqueapplication.h>
#include <tdecmdlineargs.h>
#include <tdeconfig.h>
#include <tdeaboutdata.h>
@@ -48,15 +48,15 @@ int main( int argc, char **argv )
aboutData.addAuthor("Stanislav Kljuhhin", 0, "crz@starman.ee");
aboutData.addAuthor("Christoph Neerfeld", I18N_NOOP("Original author"), "chris@kde.org");
TDECmdLineArgs::init(argc, argv, &aboutData);
- KUniqueApplication::addCmdLineOptions();
+ TDEUniqueApplication::addCmdLineOptions();
- if (!KUniqueApplication::start())
+ if (!TDEUniqueApplication::start())
{
fprintf(stderr, "kjots is already running!\n");
exit(0);
}
- KUniqueApplication a;
+ TDEUniqueApplication a;
// backwards compatibility code to convert "old" user font settings
// to the new config settings