summaryrefslogtreecommitdiffstats
path: root/kjots
diff options
context:
space:
mode:
Diffstat (limited to 'kjots')
-rw-r--r--kjots/KJotsMain.cpp236
-rw-r--r--kjots/KJotsMain.h36
-rw-r--r--kjots/kjotsbookmarks.cpp8
-rw-r--r--kjots/kjotsbookmarks.h10
-rw-r--r--kjots/kjotsedit.cpp32
-rw-r--r--kjots/kjotsedit.h6
-rw-r--r--kjots/kjotsentry.cpp266
-rw-r--r--kjots/kjotsentry.h92
-rw-r--r--kjots/main.cpp4
9 files changed, 345 insertions, 345 deletions
diff --git a/kjots/KJotsMain.cpp b/kjots/KJotsMain.cpp
index a54cead..e1dedc9 100644
--- a/kjots/KJotsMain.cpp
+++ b/kjots/KJotsMain.cpp
@@ -19,8 +19,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
-#include <qheader.h>
-#include <qwidgetstack.h>
+#include <tqheader.h>
+#include <tqwidgetstack.h>
#include <kio/netaccess.h>
@@ -63,23 +63,23 @@ KJotsMain::KJotsMain(const char* name)
//
// Main widget
//
- QWidget* f_main = new QFrame( this, "Frame_0" );
+ TQWidget* f_main = new TQFrame( this, "Frame_0" );
setCentralWidget(f_main);
- splitter = new QSplitter(f_main);
+ splitter = new TQSplitter(f_main);
splitter->setOpaqueResize( KGlobalSettings::opaqueResize() );
// the subject list
subjectList = new KListView(splitter, "subjectList");
subjectList->setRootIsDecorated(true);
- subjectList->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));
+ subjectList->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding));
subjectList->setMinimumWidth(subjectList->fontMetrics().maxWidth() * 10 + 5);
subjectList->addColumn(i18n("Pages"));
subjectList->setFullWidth(true);
- subjectList->setHScrollBarMode(QScrollView::AlwaysOff);
- subjectList->setDefaultRenameAction(QListView::Accept);
+ subjectList->setHScrollBarMode(TQScrollView::AlwaysOff);
+ subjectList->setDefaultRenameAction(TQListView::Accept);
subjectList->setSorting(-1);
- subjectList->setAlternateBackground(QColor());
+ subjectList->setAlternateBackground(TQColor());
subjectList->header()->hide();
subjectList->setDragEnabled(true);
subjectList->setAcceptDrops(true);
@@ -87,90 +87,90 @@ KJotsMain::KJotsMain(const char* name)
subjectList->setItemsRenameable(true);
subjectList->setRenameable(0,true);
- textStack = new QWidgetStack(splitter);
+ textStack = new TQWidgetStack(splitter);
me_text = new KJotsEdit(textStack, "me_text");
- me_text->setFocusPolicy(QWidget::StrongFocus);
+ me_text->setFocusPolicy(TQWidget::StrongFocus);
me_text->setEnabled(false);
textStack->addWidget(me_text);
- connect(me_text, SIGNAL(findSuccessful()), this, SLOT(slotFindSuccessful()));
+ connect(me_text, TQT_SIGNAL(findSuccessful()), this, TQT_SLOT(slotFindSuccessful()));
roTextView = new KTextBrowser(textStack, "roTextView", true);
textStack->addWidget(roTextView);
- QVBoxLayout *bookGrid = new QVBoxLayout(f_main, KDialog::marginHint(), KDialog::spacingHint());
+ TQVBoxLayout *bookGrid = new TQVBoxLayout(f_main, KDialog::marginHint(), KDialog::spacingHint());
bookGrid->addWidget(splitter, 0, 0);
bookGrid->setMargin(0);
- splitter->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding, 2, 1));
+ splitter->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding, 2, 1));
// create actions
- actions[ACTION_NEXT_BOOK] = new KAction(i18n("Next Book"), QString::null, CTRL + Key_D, this,
- SLOT(nextBook()), actionCollection(), "go_next_book");
- actions[ACTION_PREV_BOOK] = new KAction(i18n("Previous Book"), QString::null, CTRL + SHIFT + Key_D, this,
- SLOT(prevBook()), actionCollection(), "go_prev_book");
- actions[ACTION_NEXT_PAGE] = new KAction(i18n("Next Page"), QString::null, CTRL + Key_PageDown, this,
- SLOT(nextPage()), actionCollection(), "go_next_page");
- actions[ACTION_PREV_PAGE] = new KAction(i18n("Previous Page"), QString::null, CTRL + Key_PageUp, this,
- SLOT(prevPage()), actionCollection(), "go_prev_page");
-
- actions[ACTION_NEW_PAGE] = KStdAction::openNew(this, SLOT(newEntry()), actionCollection());
+ actions[ACTION_NEXT_BOOK] = new KAction(i18n("Next Book"), TQString::null, CTRL + Key_D, this,
+ TQT_SLOT(nextBook()), actionCollection(), "go_next_book");
+ actions[ACTION_PREV_BOOK] = new KAction(i18n("Previous Book"), TQString::null, CTRL + SHIFT + Key_D, this,
+ TQT_SLOT(prevBook()), actionCollection(), "go_prev_book");
+ actions[ACTION_NEXT_PAGE] = new KAction(i18n("Next Page"), TQString::null, CTRL + Key_PageDown, this,
+ TQT_SLOT(nextPage()), actionCollection(), "go_next_page");
+ actions[ACTION_PREV_PAGE] = new KAction(i18n("Previous Page"), TQString::null, CTRL + Key_PageUp, this,
+ TQT_SLOT(prevPage()), actionCollection(), "go_prev_page");
+
+ actions[ACTION_NEW_PAGE] = KStdAction::openNew(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, this,
- SLOT(createNewBook()), actionCollection(), "new_book");
+ 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..."), QString::null, 0, this,
- SLOT(writePage()), actionCollection(), "save_page_to_ascii");
+ actions[ACTION_PAGE2TEXT] = new KAction(i18n("To Text File..."), TQString::null, 0, this,
+ TQT_SLOT(writePage()), actionCollection(), "save_page_to_ascii");
actions[ACTION_PAGE2TEXT]->plug(exportPageMenu->popupMenu());
- actions[ACTION_PAGE2HTML] = new KAction(i18n("To HTML File..."), QString::null, 0, this,
- SLOT(writePageToHTML()), actionCollection(), "save_page_to_html");
+ actions[ACTION_PAGE2HTML] = new KAction(i18n("To HTML File..."), TQString::null, 0, 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..."), QString::null, 0, this,
- SLOT(writeBook()), actionCollection(), "save_book_to_ascii");
+ actions[ACTION_BOOK2TEXT] = new KAction(i18n("To Text File..."), TQString::null, 0, this,
+ TQT_SLOT(writeBook()), actionCollection(), "save_book_to_ascii");
actions[ACTION_BOOK2TEXT]->plug(exportBookMenu->popupMenu());
- actions[ACTION_BOOK2HTML] = new KAction(i18n("To HTML File..."), QString::null, 0, this,
- SLOT(writeBookToHTML()), actionCollection(), "save_book_to_html");
+ actions[ACTION_BOOK2HTML] = new KAction(i18n("To HTML File..."), TQString::null, 0, 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, this,
- SLOT(deleteEntry()), actionCollection(), "del_page");
+ TQT_SLOT(deleteEntry()), actionCollection(), "del_page");
actions[ACTION_DELETE_BOOK] = new KAction(i18n("Delete Boo&k"), "editdelete", CTRL + SHIFT + Key_Delete, this,
- SLOT(deleteBook()), actionCollection(), "del_folder");
+ TQT_SLOT(deleteBook()), actionCollection(), "del_folder");
actions[ACTION_MANUAL_SAVE] = new KAction(i18n("Manual Save"), 0, KStdAccel::save(),
- this, SLOT(autoSave()), actionCollection(), "manual_save");
- actions[ACTION_PRINT] = KStdAction::print(this, SLOT(slotPrint()), actionCollection());
- actions[ACTION_QUIT] = KStdAction::quit(this, SLOT(slotQuit()), actionCollection());
+ this, TQT_SLOT(autoSave()), actionCollection(), "manual_save");
+ actions[ACTION_PRINT] = KStdAction::print(this, TQT_SLOT(slotPrint()), actionCollection());
+ actions[ACTION_QUIT] = KStdAction::quit(this, TQT_SLOT(slotQuit()), actionCollection());
- actions[ACTION_CUT] = KStdAction::cut(me_text, SLOT(cut()), actionCollection());
- connect(me_text, SIGNAL(copyAvailable(bool)), actions[ACTION_CUT], SLOT(setEnabled(bool)));
+ actions[ACTION_CUT] = KStdAction::cut(me_text, TQT_SLOT(cut()), actionCollection());
+ connect(me_text, TQT_SIGNAL(copyAvailable(bool)), actions[ACTION_CUT], TQT_SLOT(setEnabled(bool)));
actions[ACTION_CUT]->setEnabled(false);
- actions[ACTION_COPY] = KStdAction::copy(me_text, SLOT(copy()), actionCollection());
- connect(me_text, SIGNAL(copyAvailable(bool)), actions[ACTION_COPY], SLOT(setEnabled(bool)));
+ actions[ACTION_COPY] = KStdAction::copy(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, this,
- SLOT(copySelection()), actionCollection(), "copyIntoTitle");
- connect(me_text, SIGNAL(copyAvailable(bool)), actions[ACTION_PASTE2TITLE], SLOT(setEnabled(bool)));
+ TQT_SLOT(copySelection()), actionCollection(), "copyIntoTitle");
+ connect(me_text, TQT_SIGNAL(copyAvailable(bool)), actions[ACTION_PASTE2TITLE], TQT_SLOT(setEnabled(bool)));
actions[ACTION_PASTE2TITLE]->setEnabled(false);
- actions[ACTION_PASTE] = KStdAction::pasteText(me_text, SLOT(paste()), actionCollection());
+ actions[ACTION_PASTE] = KStdAction::pasteText(me_text, TQT_SLOT(paste()), actionCollection());
- actions[ACTION_FIND] = KStdAction::find( this, SLOT( slotSearch() ), actionCollection() );
- actions[ACTION_FIND_NEXT] = KStdAction::findNext( this, SLOT( slotRepeatSearch() ), actionCollection() );
+ actions[ACTION_FIND] = KStdAction::find( this, TQT_SLOT( slotSearch() ), actionCollection() );
+ actions[ACTION_FIND_NEXT] = KStdAction::findNext( this, TQT_SLOT( slotRepeatSearch() ), actionCollection() );
actions[ACTION_FIND_NEXT]->setEnabled(false);
- actions[ACTION_REPLACE] = KStdAction::replace( this, SLOT( slotReplace() ), actionCollection() );
+ actions[ACTION_REPLACE] = KStdAction::replace( this, TQT_SLOT( slotReplace() ), actionCollection() );
- actions[ACTION_RENAME] = new KAction(i18n("Rename..."), QString::null, CTRL + Key_M, this,
- SLOT(slotRenameEntry()), actionCollection(), "rename_entry");
+ actions[ACTION_RENAME] = new KAction(i18n("Rename..."), TQString::null, CTRL + Key_M, this,
+ TQT_SLOT(slotRenameEntry()), actionCollection(), "rename_entry");
actions[ACTION_INSERT_DATE] = new KAction(i18n("Insert Date"), "date", CTRL + Key_I, this,
- SLOT(insertDate()), actionCollection(), "insert_date");
+ TQT_SLOT(insertDate()), actionCollection(), "insert_date");
- KStdAction::preferences(this, SLOT(configure()), actionCollection());
+ KStdAction::preferences(this, TQT_SLOT(configure()), actionCollection());
bookmarkMenu = new KActionMenu(i18n("&Bookmarks"), "bookmarks", actionCollection(), "bookmarks");
KJotsBookmarks* bookmarks = new KJotsBookmarks(this);
- connect(bookmarks, SIGNAL(openPage(const QString&)), SLOT(jumpToBookmark(const QString&)));
+ connect(bookmarks, TQT_SIGNAL(openPage(const TQString&)), TQT_SLOT(jumpToBookmark(const TQString&)));
new KBookmarkMenu(KBookmarkManager::managerForFile(locateLocal("appdata","bookmarks.xml")),
bookmarks, bookmarkMenu->popupMenu(),
actionCollection(), true);
@@ -186,7 +186,7 @@ KJotsMain::KJotsMain(const char* name)
}
*/
- m_autosaveTimer = new QTimer(this, "autosave_timer");
+ m_autosaveTimer = new TQTimer(this, "autosave_timer");
//
// Set startup size.
@@ -204,25 +204,25 @@ KJotsMain::KJotsMain(const char* name)
updateConfiguration();
updateMenu();
- QTimer::singleShot(0, this, SLOT(slotSetupInterface()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotSetupInterface()));
//connect new slots
- connect(subjectList, SIGNAL(selectionChanged(QListViewItem*)),
- this, SLOT(jumpToEntry(QListViewItem*)));
- connect(subjectList, SIGNAL(moved(QListViewItem*, QListViewItem*, QListViewItem*)),
- this, SLOT(slotItemMoved(QListViewItem*, QListViewItem*, QListViewItem*)));
- connect(subjectList, SIGNAL(expanded(QListViewItem*)),
- this, SLOT(slotExpandBook(QListViewItem*)));
- connect(subjectList, SIGNAL(collapsed(QListViewItem*)),
- this, SLOT(slotCollapseBook(QListViewItem*)));
- connect(subjectList, SIGNAL(contextMenu(KListView*,QListViewItem*,const QPoint&)),
- this, SLOT(showListviewContextMenu(KListView*,QListViewItem*,const QPoint&)));
- connect(subjectList, SIGNAL(itemRenamed(QListViewItem*,const QString&,int)),
- this, SLOT(slotItemRenamed(QListViewItem*,const QString&,int)));
- connect(roTextView, SIGNAL(urlClick(const QString&)),
- this, SLOT(linkClicked(const QString&)));
- connect(m_autosaveTimer, SIGNAL(timeout()),
- this, SLOT(autoSave()));
+ 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(KListView*,TQListViewItem*,const TQPoint&)),
+ this, TQT_SLOT(showListviewContextMenu(KListView*,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()));
}
void KJotsMain::slotSetupInterface()
@@ -243,16 +243,16 @@ void KJotsMain::slotSetupInterface()
*/
void KJotsMain::loadBooks()
{
- QDir dir(locateLocal("appdata",""));
- QStringList files = dir.entryList(QDir::Files|QDir::Readable);
+ TQDir dir(locateLocal("appdata",""));
+ TQStringList files = dir.entryList(TQDir::Files|TQDir::Readable);
Q_UINT64 currentSelection = KJotsSettings::currentSelection();
//TODO: Eventually we can make use of the ".book" extension here, but for
//right now (2005/06/04) there's just too much legacy data out there.
- for (QStringList::Iterator it = files.begin(); it != files.end(); it++)
+ for (TQStringList::Iterator it = files.begin(); it != files.end(); it++)
{
- QString filepath = dir.absFilePath(*it);
+ TQString filepath = dir.absFilePath(*it);
if (!KJotsBook::isBookFile(filepath) )
{
@@ -263,7 +263,7 @@ void KJotsMain::loadBooks()
book->openBook(filepath);
}
- QListViewItemIterator it( subjectList );
+ TQListViewItemIterator it( subjectList );
while ( it.current() ) {
KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(it.current());
if ( entry && entry->id() == currentSelection )
@@ -283,8 +283,8 @@ bool KJotsMain::createNewBook()
{
bool ok;
- QString name = KInputDialog::getText( i18n( "New Book" ),
- i18n( "Book name:" ), QString::null, &ok, this );
+ TQString name = KInputDialog::getText( i18n( "New Book" ),
+ i18n( "Book name:" ), TQString::null, &ok, this );
if (!ok)
return false;
@@ -315,7 +315,7 @@ void KJotsMain::deleteBook()
if (!b)
return;
- QString msg = i18n("<qt>Are you sure you want to delete the <strong>%1</strong> book?</qt>");
+ TQString msg = i18n("<qt>Are you sure you want to delete the <strong>%1</strong> book?</qt>");
int result = KMessageBox::warningContinueCancel(topLevelWidget(), msg.arg(b->subject()), i18n("Delete Book"),KStdGuiItem::del());
if (result!=KMessageBox::Continue)
@@ -399,7 +399,7 @@ void KJotsMain::configure()
confPageMisc* cpMisc = new confPageMisc(0, "Autosave");
dialog->addPage(cpMisc, i18n("Autosave"), "misc");
- connect(dialog, SIGNAL(settingsChanged()), this, SLOT(updateConfiguration()));
+ connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(updateConfiguration()));
dialog->show();
}
@@ -573,7 +573,7 @@ void KJotsMain::slotQuit()
void KJotsMain::insertDate()
{
- me_text->insert(KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true) + " ");
+ me_text->insert(KGlobal::locale()->formatDateTime(TQDateTime::currentDateTime(), true) + " ");
}
void KJotsMain::updateMenu()
@@ -654,7 +654,7 @@ void KJotsMain::slotFindSuccessful()
actions[ACTION_FIND_NEXT]->setEnabled(true);
}
-void KJotsMain::showListviewContextMenu(KListView*, QListViewItem* i, const QPoint& p)
+void KJotsMain::showListviewContextMenu(KListView*, TQListViewItem* i, const TQPoint& p)
{
if ( invalidMoveFlag ) return; //Prevent race condition
KActionMenu* am = new KActionMenu(this);
@@ -692,7 +692,7 @@ void KJotsMain::showListviewContextMenu(KListView*, QListViewItem* i, const QPoi
KTextBrowser doesn't handle anchor links itself, so we have to take
care of those, too.
*/
-void KJotsMain::linkClicked(const QString& link)
+void KJotsMain::linkClicked(const TQString& link)
{
if (link[0] == '#')
{
@@ -702,7 +702,7 @@ void KJotsMain::linkClicked(const QString& link)
}
Q_UINT64 target = link.toULongLong();
- QListViewItemIterator it( subjectList );
+ TQListViewItemIterator it( subjectList );
while ( it.current() ) {
KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(it.current());
if ( entry && entry->id() == target )
@@ -743,7 +743,7 @@ void KJotsMain::saveProperties()
/*!
\brief Called when a book is opened/expanded/whatever.
*/
-void KJotsMain::slotExpandBook(QListViewItem *item)
+void KJotsMain::slotExpandBook(TQListViewItem *item)
{
KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(item);
if ( entry ) entry->setDirty(true);
@@ -752,7 +752,7 @@ void KJotsMain::slotExpandBook(QListViewItem *item)
/*!
\brief Called when a book is closed/collapsed/whatever.
*/
-void KJotsMain::slotCollapseBook(QListViewItem *item)
+void KJotsMain::slotCollapseBook(TQListViewItem *item)
{
KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(item);
if ( entry ) entry->setDirty(true);
@@ -761,10 +761,10 @@ void KJotsMain::slotCollapseBook(QListViewItem *item)
/*!
Returns the name of the active book or page.
*/
-QString KJotsMain::currentBookmarkTitle()
+TQString KJotsMain::currentBookmarkTitle()
{
- QString title;
- QListViewItem *item = subjectList->currentItem();
+ TQString title;
+ TQListViewItem *item = subjectList->currentItem();
while ( item )
{
@@ -785,9 +785,9 @@ QString KJotsMain::currentBookmarkTitle()
/*!
Returns a bookmark that identifies the active book or page.
*/
-QString KJotsMain::currentBookmarkURL()
+TQString KJotsMain::currentBookmarkURL()
{
- QString url;
+ TQString url;
KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(subjectList->currentItem());
if ( entry )
@@ -802,13 +802,13 @@ QString KJotsMain::currentBookmarkURL()
Accepts a bookmark from the bookmark manager and jumps to the given entry.
\param bookmark The bookmark.
*/
-void KJotsMain::jumpToBookmark(const QString& bookmark)
+void KJotsMain::jumpToBookmark(const TQString& bookmark)
{
Q_UINT64 id = bookmark.toULongLong();
if ( id )
{
- QListViewItemIterator it( subjectList );
+ TQListViewItemIterator it( subjectList );
while ( it.current() ) {
KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(it.current());
if ( entry && entry->id() == id )
@@ -825,13 +825,13 @@ void KJotsMain::jumpToBookmark(const QString& bookmark)
//in the future. CREATION DATE: 2005/06/10
KMessageBox::information(this,
- i18n("This bookmark is from an older version of KJots and is not fully supported. It may or may not work. You should delete and recreate this bookmark."), QString::null, "oldBookmarkWarning");
+ i18n("This bookmark is from an older version of KJots and is not fully supported. It may or may not work. You should delete and recreate this bookmark."), TQString::null, "oldBookmarkWarning");
int slash = bookmark.findRev('/');
if (slash != -1)
{
- QString bookName = bookmark.left(slash);
+ TQString bookName = bookmark.left(slash);
int pageNo = bookmark.mid(slash+1).toInt();
int pageCount = 0;
@@ -865,7 +865,7 @@ void KJotsMain::jumpToBookmark(const QString& bookmark)
{
if ( ++pageCount == pageNo )
{
- static_cast<QListViewItem*>(entry)->parent()->setOpen(true);
+ static_cast<TQListViewItem*>(entry)->parent()->setOpen(true);
subjectList->ensureItemVisible(entry);
subjectList->setSelected(entry, true);
jumpToEntry(entry);
@@ -885,11 +885,11 @@ void KJotsMain::jumpToBookmark(const QString& bookmark)
*/
void KJotsMain::nextBook()
{
- QListViewItem *item = subjectList->currentItem();
+ TQListViewItem *item = subjectList->currentItem();
if ( !item ) return; //sanity check
- QListViewItemIterator it ( item );
- QListViewItemIterator start ( it );
+ TQListViewItemIterator it ( item );
+ TQListViewItemIterator start ( it );
do {
it++;
@@ -897,7 +897,7 @@ void KJotsMain::nextBook()
//if we iterate off the list, start over again.
if ( !it.current() )
{
- it = QListViewItemIterator ( subjectList );
+ it = TQListViewItemIterator ( subjectList );
}
if ( it.current() == start.current() ) return; //Bail out if we loop.
@@ -915,20 +915,20 @@ void KJotsMain::nextBook()
void KJotsMain::prevBook()
{
//Don't get caught by parent book.
- QListViewItem *startingPoint = subjectList->currentItem();
+ TQListViewItem *startingPoint = subjectList->currentItem();
if ( !startingPoint ) return; //sanity check
if ( dynamic_cast<KJotsPage*>(startingPoint) )
startingPoint = startingPoint->parent();
- QListViewItemIterator it ( startingPoint );
+ TQListViewItemIterator it ( startingPoint );
do {
it--;
//if we iterate off the list, start over again.
if ( !it.current() )
{
- it = QListViewItemIterator ( subjectList->lastItem() );
+ it = TQListViewItemIterator ( subjectList->lastItem() );
}
if ( it.current() == startingPoint ) return; //Bail out if we loop.
@@ -945,11 +945,11 @@ void KJotsMain::prevBook()
*/
void KJotsMain::nextPage()
{
- QListViewItem *item = subjectList->currentItem();
+ TQListViewItem *item = subjectList->currentItem();
if ( !item ) return; //sanity check
- QListViewItemIterator it ( item );
- QListViewItemIterator start ( it );
+ TQListViewItemIterator it ( item );
+ TQListViewItemIterator start ( it );
do {
it++;
@@ -957,7 +957,7 @@ void KJotsMain::nextPage()
//if we iterate off the list, start over again.
if ( !it.current() )
{
- it = QListViewItemIterator ( subjectList );
+ it = TQListViewItemIterator ( subjectList );
}
if ( it.current() == start.current() ) return; //Bail out if we loop.
@@ -974,11 +974,11 @@ void KJotsMain::nextPage()
*/
void KJotsMain::prevPage()
{
- QListViewItem *item = subjectList->currentItem();
+ TQListViewItem *item = subjectList->currentItem();
if ( !item ) return; //sanity check
- QListViewItemIterator it ( item );
- QListViewItemIterator start ( it );
+ TQListViewItemIterator it ( item );
+ TQListViewItemIterator start ( it );
do {
it--;
@@ -986,7 +986,7 @@ void KJotsMain::prevPage()
//if we iterate off the list, start over again.
if ( !it.current() )
{
- it = QListViewItemIterator ( subjectList->lastItem() );
+ it = TQListViewItemIterator ( subjectList->lastItem() );
}
if ( it.current() == start.current() ) return; //Bail out if we loop.
@@ -998,7 +998,7 @@ void KJotsMain::prevPage()
return;
}
-void KJotsMain::jumpToEntry(QListViewItem* entry, bool force)
+void KJotsMain::jumpToEntry(TQListViewItem* entry, bool force)
{
//This won't lose data or anything; but it does reset the cursor postion and waste cycles.
if (currentEntry == entry && !force)
@@ -1014,7 +1014,7 @@ void KJotsMain::jumpToEntry(QListViewItem* entry, bool force)
me_text->setEntry(0); //clear any old data
KJotsBook* book = static_cast<KJotsBook*>(entry);
- QString html = book->generateHtml(book, false);
+ TQString html = book->generateHtml(book, false);
roTextView->setText(html);
roTextView->setCursorPosition(0, 0);
@@ -1037,8 +1037,8 @@ void KJotsMain::jumpToEntry(QListViewItem* entry, bool force)
*/
void KJotsMain::updateCaption()
{
- QString caption;
- QListViewItem *item = subjectList->currentItem();
+ TQString caption;
+ TQListViewItem *item = subjectList->currentItem();
while ( item )
{
@@ -1057,7 +1057,7 @@ void KJotsMain::updateCaption()
return;
}
-void KJotsMain::slotItemRenamed(QListViewItem* item, const QString& str, int /*col*/)
+void KJotsMain::slotItemRenamed(TQListViewItem* item, const TQString& str, int /*col*/)
{
KJotsEntryBase* entry = dynamic_cast<KJotsEntryBase*>(item);
@@ -1075,7 +1075,7 @@ void KJotsMain::slotItemRenamed(QListViewItem* item, const QString& str, int /*
\warning The whole drag-n-drop reordering system is completely booched.
Tread lightly and test well when modifying things here.
*/
-void KJotsMain::slotItemMoved(QListViewItem *item, QListViewItem* afterFirst, QListViewItem */*afterNow*/ )
+void KJotsMain::slotItemMoved(TQListViewItem *item, TQListViewItem* afterFirst, TQListViewItem */*afterNow*/ )
{
KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(item);
@@ -1083,7 +1083,7 @@ void KJotsMain::slotItemMoved(QListViewItem *item, QListViewItem* afterFirst, QL
//previous sibling, not just the entry directly above it.
if ( afterFirst && afterFirst->parent() != entry->parentBook() )
{
- QListViewItemIterator it ( afterFirst );
+ TQListViewItemIterator it ( afterFirst );
afterFirst = 0;
//Rewind backwards up the tree...
@@ -1119,7 +1119,7 @@ void KJotsMain::slotItemMoved(QListViewItem *item, QListViewItem* afterFirst, QL
i18n("All pages must be inside a book. "
"Would you like to create a new book to put the page in, "
"or would you prefer to not move the page at all?"),
- QString::null,
+ TQString::null,
i18n("Create New Book"), i18n("Do Not Move Page")) ==
KMessageBox::No ||
!createNewBook())
diff --git a/kjots/KJotsMain.h b/kjots/KJotsMain.h
index 28ec089..c4a3297 100644
--- a/kjots/KJotsMain.h
+++ b/kjots/KJotsMain.h
@@ -23,8 +23,8 @@
#ifndef KJotsMain_included
#define KJotsMain_included
-#include <qlayout.h>
-#include <qpushbutton.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
#include <kdialogbase.h>
#include <kmainwindow.h>
@@ -86,8 +86,8 @@ class KJotsMain : public KMainWindow
public:
KJotsMain( const char* name = 0 );
- QString currentBookmarkTitle();
- QString currentBookmarkURL();
+ TQString currentBookmarkTitle();
+ TQString currentBookmarkURL();
public:
void updateCaption();
@@ -111,12 +111,12 @@ class KJotsMain : public KMainWindow
void slotQuit();
void slotFindSuccessful();
- void jumpToEntry(QListViewItem* entry, bool=false);
+ void jumpToEntry(TQListViewItem* entry, bool=false);
- void slotExpandBook(QListViewItem* item);
- void slotCollapseBook(QListViewItem* item);
- void slotItemRenamed(QListViewItem*,const QString&,int);
- void slotItemMoved(QListViewItem*,QListViewItem*,QListViewItem*);
+ void slotExpandBook(TQListViewItem* item);
+ void slotCollapseBook(TQListViewItem* item);
+ void slotItemRenamed(TQListViewItem*,const TQString&,int);
+ void slotItemMoved(TQListViewItem*,TQListViewItem*,TQListViewItem*);
void writeBook();
void writeBookToHTML();
void saveBookToFile(bool plainText);
@@ -130,12 +130,12 @@ class KJotsMain : public KMainWindow
void prevPage();
// handling page changes in the listview
- void showListviewContextMenu(KListView* l, QListViewItem* i, const QPoint& p);
- void linkClicked(const QString&);
+ void showListviewContextMenu(KListView* l, TQListViewItem* i, const TQPoint& p);
+ void linkClicked(const TQString&);
void autoSave(void);
// bookmarks
- void jumpToBookmark(const QString& page);
+ void jumpToBookmark(const TQString& page);
protected:
void saveProperties();
@@ -145,16 +145,16 @@ class KJotsMain : public KMainWindow
KJotsBook* currentBook();
KJotsPage* currentPage();
- QHBoxLayout *bg_top_layout;
- QButtonGroup *bg_top;
+ TQHBoxLayout *bg_top_layout;
+ TQButtonGroup *bg_top;
KJotsEdit *me_text;
KTextBrowser *roTextView;
KListView *subjectList;
KJotsEntryBase *currentEntry;
- QSplitter *splitter;
- QWidgetStack *textStack;
- QFont m_font;
- QTimer* m_autosaveTimer;
+ TQSplitter *splitter;
+ TQWidgetStack *textStack;
+ TQFont m_font;
+ TQTimer* m_autosaveTimer;
bool invalidMoveFlag; //!< Used to fix a race condition. See Bug #109299
KAction* actions[ACTION_MAX];
diff --git a/kjots/kjotsbookmarks.cpp b/kjots/kjotsbookmarks.cpp
index b339a46..21ce6e8 100644
--- a/kjots/kjotsbookmarks.cpp
+++ b/kjots/kjotsbookmarks.cpp
@@ -24,7 +24,7 @@
#include "kjotsbookmarks.h"
KJotsBookmarks::KJotsBookmarks(KJotsMain* parent, const char* name)
- : QObject(parent, name),
+ : TQObject(parent, name),
m_kjots(parent)
{
}
@@ -33,17 +33,17 @@ KJotsBookmarks::~KJotsBookmarks()
{
}
-void KJotsBookmarks::openBookmarkURL(const QString& page)
+void KJotsBookmarks::openBookmarkURL(const TQString& page)
{
emit openPage(page);
}
-QString KJotsBookmarks::currentURL() const
+TQString KJotsBookmarks::currentURL() const
{
return m_kjots->currentBookmarkURL();
}
-QString KJotsBookmarks::currentTitle() const
+TQString KJotsBookmarks::currentTitle() const
{
return m_kjots->currentBookmarkTitle();
}
diff --git a/kjots/kjotsbookmarks.h b/kjots/kjotsbookmarks.h
index 7cb3144..9fa533d 100644
--- a/kjots/kjotsbookmarks.h
+++ b/kjots/kjotsbookmarks.h
@@ -27,7 +27,7 @@
class KJotsMain;
-class KJotsBookmarks : public QObject, public KBookmarkOwner
+class KJotsBookmarks : public TQObject, public KBookmarkOwner
{
Q_OBJECT
@@ -35,12 +35,12 @@ class KJotsBookmarks : public QObject, public KBookmarkOwner
KJotsBookmarks(KJotsMain* parent = 0, const char* name = 0);
~KJotsBookmarks();
- virtual void openBookmarkURL(const QString& url);
- virtual QString currentURL() const;
- QString currentTitle() const;
+ virtual void openBookmarkURL(const TQString& url);
+ virtual TQString currentURL() const;
+ TQString currentTitle() const;
signals:
- void openPage(const QString& page);
+ void openPage(const TQString& page);
private:
KJotsMain* m_kjots;
diff --git a/kjots/kjotsedit.cpp b/kjots/kjotsedit.cpp
index 0a61c62..2e4c09d 100644
--- a/kjots/kjotsedit.cpp
+++ b/kjots/kjotsedit.cpp
@@ -20,9 +20,9 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
-#include <qcursor.h>
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqcursor.h>
#include <kpopupmenu.h>
#include <keditcl.h>
@@ -36,16 +36,16 @@
//----------------------------------------------------------------------
// MYMULTIEDIT
//----------------------------------------------------------------------
-KJotsEdit::KJotsEdit (QWidget* parent, const char* name)
+KJotsEdit::KJotsEdit (TQWidget* parent, const char* name)
: KEdit(parent, name),
m_entry(0)
{
// no rich text until printing and other such issues are worked out
setTextFormat(Qt::PlainText);
- setWordWrap(QTextEdit::WidgetWidth);
+ setWordWrap(TQTextEdit::WidgetWidth);
setLinkUnderline(true);
web_menu = new KPopupMenu(this);;
- web_menu->insertItem(i18n("Open URL"), this, SLOT(openUrl()) );
+ web_menu->insertItem(i18n("Open URL"), this, TQT_SLOT(openUrl()) );
}
KJotsEdit::~KJotsEdit()
@@ -53,7 +53,7 @@ KJotsEdit::~KJotsEdit()
}
-void KJotsEdit::mousePressEvent( QMouseEvent *e )
+void KJotsEdit::mousePressEvent( TQMouseEvent *e )
{
if(e->button() == RightButton &&
hasSelectedText())
@@ -62,7 +62,7 @@ void KJotsEdit::mousePressEvent( QMouseEvent *e )
if(url.isValid())
{
- web_menu->popup(QCursor::pos());
+ web_menu->popup(TQCursor::pos());
return;
}
}
@@ -82,7 +82,7 @@ void KJotsEdit::openUrl()
}
}
-void KJotsEdit::print(QString title)
+void KJotsEdit::print(TQString title)
{
KPrinter printer;
printer.setDocName(title);
@@ -91,19 +91,19 @@ void KJotsEdit::print(QString title)
if (printer.setup(this))
{
- QFont printFont = font();
- QPainter painter( &printer );
- QPaintDeviceMetrics metrics( &printer );
+ TQFont printFont = font();
+ TQPainter painter( &printer );
+ TQPaintDeviceMetrics metrics( &printer );
int y = 0;
int maxWidth = metrics.width();
int maxHeight = metrics.height();
- QString currentParagraph;
+ TQString currentParagraph;
for (int paragraphCount = 0; paragraphCount < paragraphs(); ++paragraphCount )
{
currentParagraph = text(paragraphCount);
- QRect r = painter.boundingRect(0, y, maxWidth, maxHeight,
- QPainter::ExpandTabs | QPainter::WordBreak,
+ TQRect r = painter.boundingRect(0, y, maxWidth, maxHeight,
+ TQPainter::ExpandTabs | TQPainter::WordBreak,
currentParagraph);
if ((y + r.height()) > maxHeight)
@@ -113,7 +113,7 @@ void KJotsEdit::print(QString title)
}
painter.drawText(0, y, maxWidth, maxHeight - y,
- QPainter::ExpandTabs | QPainter::WordBreak,
+ TQPainter::ExpandTabs | TQPainter::WordBreak,
currentParagraph);
y += r.height();
}
diff --git a/kjots/kjotsedit.h b/kjots/kjotsedit.h
index cae025c..d214ce3 100644
--- a/kjots/kjotsedit.h
+++ b/kjots/kjotsedit.h
@@ -31,10 +31,10 @@ class KJotsEdit : public KEdit
{
Q_OBJECT
public:
- KJotsEdit (QWidget* parent=0, const char* name=0);
+ KJotsEdit (TQWidget* parent=0, const char* name=0);
~KJotsEdit ();
- void print(QString title = QString::null);
+ void print(TQString title = TQString::null);
void setEntry(KJotsPage*);
signals:
@@ -44,7 +44,7 @@ class KJotsEdit : public KEdit
void openUrl();
protected:
- virtual void mousePressEvent (QMouseEvent *e);
+ virtual void mousePressEvent (TQMouseEvent *e);
KPopupMenu *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 a27b00e..dab39c8 100644
--- a/kjots/kjotsentry.cpp
+++ b/kjots/kjotsentry.cpp
@@ -20,11 +20,11 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
-#include <qdir.h>
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
-#include <qtextcodec.h>
-#include <qdom.h>
+#include <tqdir.h>
+#include <tqpainter.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqtextcodec.h>
+#include <tqdom.h>
#include <kapplication.h>
#include <kiconloader.h>
@@ -44,7 +44,7 @@
#include "kjotsentry.h"
// helper functions for HTML output
-QString prepForHTML(QString text)
+TQString prepForHTML(TQString text)
{
text.replace("<", "&lt;");
text.replace(">", "&gt;");
@@ -52,15 +52,15 @@ QString prepForHTML(QString text)
return text;
}
-QString htmlHeader(const QString& title, QTextCodec* codec)
+TQString htmlHeader(const TQString& title, TQTextCodec* codec)
{
- QString head = "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=";
+ TQString head = "<html><head><meta http-equiv=\"content-type\" content=\"text/html; charset=";
head+=codec->mimeName();
head+="\" ><title>" + prepForHTML(title) + "</title></head><body>";
return head;
}
-QString htmlFooter()
+TQString htmlFooter()
{
return "</body></html>";
}
@@ -69,7 +69,7 @@ QString htmlFooter()
// KJotsEntryBase
//
-KJotsEntryBase::KJotsEntryBase(KListView* parent, QListViewItem* after=0)
+KJotsEntryBase::KJotsEntryBase(KListView* parent, TQListViewItem* after=0)
:KListViewItem(parent,after)
{
m_id = 0;
@@ -77,7 +77,7 @@ KJotsEntryBase::KJotsEntryBase(KListView* parent, QListViewItem* after=0)
m_parent = 0;
}
-KJotsEntryBase::KJotsEntryBase(KListViewItem* parent, QListViewItem* after=0)
+KJotsEntryBase::KJotsEntryBase(KListViewItem* parent, TQListViewItem* after=0)
:KListViewItem(parent,after)
{
m_id = 0;
@@ -85,12 +85,12 @@ KJotsEntryBase::KJotsEntryBase(KListViewItem* parent, QListViewItem* after=0)
m_parent = dynamic_cast<KJotsBook*>(parent);
}
-void KJotsEntryBase::setSubject(const QString& subj)
+void KJotsEntryBase::setSubject(const TQString& subj)
{
setText(0, subj);
}
-void KJotsEntryBase::setText(int column, const QString& text)
+void KJotsEntryBase::setText(int column, const TQString& text)
{
if (column == 0 && text.isEmpty())
KListViewItem::setText(0, defaultSubject());
@@ -105,7 +105,7 @@ void KJotsEntryBase::setText(int column, const QString& text)
*/
void KJotsEntryBase::resetParent()
{
- m_parent = dynamic_cast<KJotsBook*>(QListViewItem::parent());
+ m_parent = dynamic_cast<KJotsBook*>(TQListViewItem::parent());
}
/*!
@@ -139,14 +139,14 @@ void KJotsEntryBase::setId(Q_UINT64 id)
This function should ONLY be called when saving the file, as it performs
other functions than generating XML.
*/
-void KJotsEntryBase::generateXml( QDomDocument &doc, QDomElement &parent )
+void KJotsEntryBase::generateXml( TQDomDocument &doc, TQDomElement &parent )
{
- QDomElement title = doc.createElement( "Title" );
+ TQDomElement title = doc.createElement( "Title" );
title.appendChild( doc.createTextNode( subject() ));
parent.appendChild( title );
- QDomElement id = doc.createElement( "ID" );
- QString id_string;
+ TQDomElement id = doc.createElement( "ID" );
+ TQString id_string;
id_string.setNum(m_id);
id.appendChild( doc.createTextNode(id_string) );
parent.appendChild( id );
@@ -158,7 +158,7 @@ void KJotsEntryBase::generateXml( QDomDocument &doc, QDomElement &parent )
/*!
Parses through XML data for settings inherent to the base class.
*/
-void KJotsEntryBase::parseXml( QDomElement &e )
+void KJotsEntryBase::parseXml( TQDomElement &e )
{
if ( !e.isNull() )
{
@@ -180,15 +180,15 @@ void KJotsEntryBase::parseXml( QDomElement &e )
\brief Draws the Title box when printing.
This is a helper function for the derived classes. Code consolidation==the good.
*/
-int KJotsEntryBase::printTitleBox(QString title, KPrinter& printer, QPainter& painter, int y)
+int KJotsEntryBase::printTitleBox(TQString title, KPrinter& printer, TQPainter& painter, int y)
{
- QPaintDeviceMetrics metrics( &printer );
+ TQPaintDeviceMetrics metrics( &printer );
int maxWidth = metrics.width();
int maxHeight = metrics.height();
- QRect r = painter.boundingRect(0, y,
+ TQRect r = painter.boundingRect(0, y,
maxWidth, maxHeight,
- QPainter::ExpandTabs | QPainter::WordBreak | QPainter::AlignHCenter,
+ TQPainter::ExpandTabs | TQPainter::WordBreak | TQPainter::AlignHCenter,
title);
y += 10;
@@ -206,7 +206,7 @@ int KJotsEntryBase::printTitleBox(QString title, KPrinter& printer, QPainter& pa
r.setRight(maxWidth);
painter.drawRect(r);
painter.drawText(0, y, maxWidth, maxHeight - y,
- QPainter::ExpandTabs | QPainter::WordBreak | QPainter::AlignHCenter,
+ TQPainter::ExpandTabs | TQPainter::WordBreak | TQPainter::AlignHCenter,
title);
y += r.height() + 15;
@@ -217,13 +217,13 @@ int KJotsEntryBase::printTitleBox(QString title, KPrinter& printer, QPainter& pa
// KJotsBook
//
-KJotsBook::KJotsBook(KListView* parent, QListViewItem* after)
+KJotsBook::KJotsBook(KListView* parent, TQListViewItem* after)
: KJotsEntryBase(parent, after)
{
init();
}
-KJotsBook::KJotsBook(KListViewItem* parent, QListViewItem* after)
+KJotsBook::KJotsBook(KListViewItem* parent, TQListViewItem* after)
: KJotsEntryBase(parent, after)
{
init();
@@ -245,7 +245,7 @@ void KJotsBook::init()
m_open = false;
m_saveProgressDialog = 0;
setExpandable(true);
- setPixmap(0, kapp->iconLoader()->loadIcon(QString("contents"),KIcon::Small));
+ setPixmap(0, kapp->iconLoader()->loadIcon(TQString("contents"),KIcon::Small));
}
/*!
@@ -255,18 +255,18 @@ void KJotsBook::init()
This function does a cursory check to see if this looks like it is a KJots file.
It's a little too quick and dirty for my taste, but seems to work OK.
*/
-bool KJotsBook::isBookFile(const QString& filename)
+bool KJotsBook::isBookFile(const TQString& filename)
{
- QFile folder(filename);
+ TQFile folder(filename);
bool test = false;
if ( folder.exists() )
{
if ( folder.open(IO_ReadWrite) )
{
- QTextStream st(static_cast<QIODevice*>(&folder));
- st.setEncoding( KJotsSettings::unicode() ? QTextStream::UnicodeUTF8 : QTextStream::Locale );
- QString buf = st.readLine().stripWhiteSpace();
+ TQTextStream st(static_cast<TQIODevice*>(&folder));
+ st.setEncoding( KJotsSettings::unicode() ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale );
+ TQString buf = st.readLine().stripWhiteSpace();
//Check for new-style book. Not very pretty, but it is faster than loading the DOM.
if (buf == "<!DOCTYPE KJots>")
@@ -290,7 +290,7 @@ bool KJotsBook::isBookFile(const QString& filename)
\brief Reads a book in from a disk file.
This function is only called for root-level books.
*/
-bool KJotsBook::openBook(const QString& filename)
+bool KJotsBook::openBook(const TQString& filename)
{
if ( !m_open ) //sanity check
{
@@ -302,25 +302,25 @@ bool KJotsBook::openBook(const QString& filename)
addPage();
m_open = true;
} else {
- QFile file(m_fileName);
+ TQFile file(m_fileName);
if ( file.exists() && file.open(IO_ReadWrite) ) //TODO: Implement read-only mode?
{
- QTextStream st(static_cast<QIODevice*>(&file));
- st.setEncoding( KJotsSettings::unicode() ? QTextStream::UnicodeUTF8 : QTextStream::Locale );
- QString data = st.read();
+ TQTextStream st(static_cast<TQIODevice*>(&file));
+ st.setEncoding( KJotsSettings::unicode() ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale );
+ TQString data = st.read();
- QDomDocument doc( "KJots" );
+ TQDomDocument doc( "KJots" );
if ( doc.setContent( data ) )
{
- QDomElement docElem = doc.documentElement();
+ TQDomElement docElem = doc.documentElement();
if ( docElem.tagName() == "KJots" )
{
- QDomNode n = docElem.firstChild();
+ TQDomNode n = docElem.firstChild();
while( !n.isNull() )
{
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if( !e.isNull() && e.tagName() == "KJotsBook" )
{
parseXml(e);
@@ -334,7 +334,7 @@ bool KJotsBook::openBook(const QString& filename)
file.reset();
if ( loadOldBook(file) )
{
- QFileInfo fi( file );
+ TQFileInfo fi( file );
setSubject(fi.fileName());
}
}
@@ -354,7 +354,7 @@ bool KJotsBook::openBook(const QString& filename)
if ( !m_fileName.isEmpty() && !m_fileName.endsWith(".book") )
{
//some old books have incorrect names. So we save a new copy, then kill the old file
- m_fileName = QString::null; //trick ourselves into thinking we're a new book
+ m_fileName = TQString::null; //trick ourselves into thinking we're a new book
saveBook();
file.remove();
}
@@ -386,11 +386,11 @@ bool KJotsBook::openBook(const QString& filename)
This is a function for files made from older KJots versions. It could probably be removed
at some point in the future. CREATION DATE: 2005/05/30
*/
-bool KJotsBook::loadOldBook(QFile &file)
+bool KJotsBook::loadOldBook(TQFile &file)
{
- QTextStream st(static_cast<QIODevice*>(&file));
- st.setEncoding( KJotsSettings::unicode() ? QTextStream::UnicodeUTF8 : QTextStream::Locale );
- QString buf = st.readLine();
+ TQTextStream st(static_cast<TQIODevice*>(&file));
+ st.setEncoding( KJotsSettings::unicode() ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale );
+ TQString buf = st.readLine();
if (buf.left(9) != "\\NewEntry")
{
@@ -399,7 +399,7 @@ bool KJotsBook::loadOldBook(QFile &file)
}
KJotsPage *entry = 0;
- QString body;
+ TQString body;
bool quit=false;
@@ -412,8 +412,8 @@ bool KJotsBook::loadOldBook(QFile &file)
entry->setBody(body);
}
- body = QString::null;
- QString title = buf.mid(10, buf.length());
+ body = TQString::null;
+ TQString title = buf.mid(10, buf.length());
// now catch the page id
buf = st.readLine();
@@ -461,17 +461,17 @@ void KJotsBook::saveBook(void)
m_fileName = temp.name();
}
- QFile file(m_fileName);
+ TQFile file(m_fileName);
if (file.open(IO_WriteOnly | IO_Truncate))
{
- QDomDocument doc("KJots");
- QDomElement root = doc.createElement( "KJots" );
+ TQDomDocument doc("KJots");
+ TQDomElement root = doc.createElement( "KJots" );
doc.appendChild( root );
this->generateXml( doc, root ); //recursive
- QTextStream st((QIODevice *) &file);
- st.setEncoding( KJotsSettings::unicode() ? QTextStream::UnicodeUTF8 : QTextStream::Locale );
+ TQTextStream st((TQIODevice *) &file);
+ st.setEncoding( KJotsSettings::unicode() ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale );
st << doc.toString();
file.close();
@@ -487,14 +487,14 @@ void KJotsBook::saveBook(void)
*/
void KJotsBook::deleteBook()
{
- QFile::remove(m_fileName);
- m_fileName = QString::null;
+ TQFile::remove(m_fileName);
+ m_fileName = TQString::null;
}
void KJotsBook::rename()
{
bool ok;
- QString name = KInputDialog::getText(i18n( "Rename Book" ),
+ TQString name = KInputDialog::getText(i18n( "Rename Book" ),
i18n( "Book name:" ),
subject(), &ok, listView());
if (ok)
@@ -514,13 +514,13 @@ void KJotsBook::rename()
\brief Initiated when the user chooses to save this to a file.
This function gets everything ready to go to save to the disk.
*/
-void KJotsBook::saveToFile(KURL url, bool plainText, const QString& encoding)
+void KJotsBook::saveToFile(KURL url, bool plainText, const TQString& encoding)
{
if (url.isEmpty() || m_saveInProgress)
return;
m_saveToPlainText = plainText;
- m_saveEncoding = QTextCodec::codecForName(encoding.ascii());
+ m_saveEncoding = TQTextCodec::codecForName(encoding.ascii());
KIO::TransferJob* job = KIO::put(url, -1, true, false, false);
if (!job)
@@ -541,8 +541,8 @@ void KJotsBook::saveToFile(KURL url, bool plainText, const QString& encoding)
m_saveProgressDialog->showCancelButton(false);
m_saveProgressDialog->setAutoClose(true);
- connect(job, SIGNAL(dataReq(KIO::Job*, QByteArray&)), SLOT(saveDataReq(KIO::Job*, QByteArray&)));
- connect(job, SIGNAL(result( KIO::Job *)), SLOT(slotSaveResult( KIO::Job *)));
+ connect(job, TQT_SIGNAL(dataReq(KIO::Job*, TQByteArray&)), TQT_SLOT(saveDataReq(KIO::Job*, TQByteArray&)));
+ connect(job, TQT_SIGNAL(result( KIO::Job *)), TQT_SLOT(slotSaveResult( KIO::Job *)));
m_saveInProgress = true;
}
@@ -551,11 +551,11 @@ void KJotsBook::saveToFile(KURL url, bool plainText, const QString& encoding)
\brief Pumps out data when saving to a file.
This function pumps out page data during a disk save.
*/
-void KJotsBook::saveDataReq(KIO::Job* /* job */, QByteArray& data)
+void KJotsBook::saveDataReq(KIO::Job* /* job */, TQByteArray& data)
{
if (!m_saveInProgress) return; //sanity check
- QTextStream stream(data, IO_WriteOnly);
+ TQTextStream stream(data, IO_WriteOnly);
stream.setCodec(m_saveEncoding);
if (!m_saveToPlainText)
@@ -588,10 +588,10 @@ void KJotsBook::slotSaveResult(KIO::Job *)
*/
KJotsPage* KJotsBook::addPage()
{
- QListViewItem *after = 0;
+ TQListViewItem *after = 0;
// append new pages
- QListViewItem* tmp = firstChild();
+ TQListViewItem* tmp = firstChild();
while (tmp)
{
after = tmp;
@@ -606,7 +606,7 @@ KJotsPage* KJotsBook::addPage()
/*!
\brief Called when the user wants to print the book.
*/
-void KJotsBook::print(QFont& defaultFont)
+void KJotsBook::print(TQFont& defaultFont)
{
KPrinter printer;
printer.setDocName(subject());
@@ -618,7 +618,7 @@ void KJotsBook::print(QFont& defaultFont)
return;
}
- QPainter painter(&printer);
+ TQPainter painter(&printer);
painter.setFont(defaultFont);
print(printer, painter, 0);
@@ -628,7 +628,7 @@ void KJotsBook::print(QFont& defaultFont)
/*!
\brief Prints this book.
*/
-int KJotsBook::print(KPrinter& printer, QPainter& painter, int y)
+int KJotsBook::print(KPrinter& printer, TQPainter& painter, int y)
{
y = printTitleBox(subject(), printer, painter, y);
@@ -642,7 +642,7 @@ int KJotsBook::print(KPrinter& printer, QPainter& painter, int y)
return y;
}
-QString KJotsBook::defaultSubject()
+TQString KJotsBook::defaultSubject()
{
return i18n("Untitled Book");
}
@@ -672,14 +672,14 @@ bool KJotsBook::isDirty()
\brief Creates XML code and performs necessary tasks to save file.
This function should ONLY be called when saving the file.
*/
-void KJotsBook::generateXml( QDomDocument &doc, QDomElement &parent )
+void KJotsBook::generateXml( TQDomDocument &doc, TQDomElement &parent )
{
- QDomElement book = doc.createElement( "KJotsBook" );
+ TQDomElement book = doc.createElement( "KJotsBook" );
parent.appendChild( book );
KJotsEntryBase::generateXml(doc, book); //let the base class save important stuff
- QDomElement open = doc.createElement( "Open" );
+ TQDomElement open = doc.createElement( "Open" );
open.appendChild( this->isOpen() ? doc.createTextNode("1") : doc.createTextNode("0") );
book.appendChild( open );
@@ -690,7 +690,7 @@ void KJotsBook::generateXml( QDomDocument &doc, QDomElement &parent )
entry = dynamic_cast<KJotsEntryBase*>(entry->nextSibling());
}
- if ( !m_fileName.isEmpty() && QListViewItem::parent() )
+ if ( !m_fileName.isEmpty() && TQListViewItem::parent() )
{
//Hmmmm... We were originally loaded from a file, but now we have a parent, so
//we must have been moved into another tree. Remove the old file now that we
@@ -704,16 +704,16 @@ void KJotsBook::generateXml( QDomDocument &doc, QDomElement &parent )
/*!
Parses through XML code from a file.
*/
-void KJotsBook::parseXml( QDomElement &me )
+void KJotsBook::parseXml( TQDomElement &me )
{
KJotsEntryBase *lastEntry = 0; //keep track of the last entry inserted for speed
if ( me.tagName() == "KJotsBook" )
{
- QDomNode n = me.firstChild();
+ TQDomNode n = me.firstChild();
while( !n.isNull() )
{
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if ( !e.isNull() )
{
if ( e.tagName() == "KJotsPage" )
@@ -754,16 +754,16 @@ void KJotsBook::parseXml( QDomElement &me )
\brief Returns an HTML Table of contents for this book.
This is a helper function for generateHtml().
*/
-QString KJotsBook::getToc()
+TQString KJotsBook::getToc()
{
- QString toc;
+ TQString toc;
toc += "<ul>";
KJotsEntryBase *entry = dynamic_cast<KJotsEntryBase*>(firstChild());
while ( entry ) {
- QString htmlSubject = prepForHTML(entry->subject());
- toc += QString("<li><a href=\"#%1\">").arg(entry->id()) + htmlSubject + "</a></li>";
+ TQString htmlSubject = prepForHTML(entry->subject());
+ toc += TQString("<li><a href=\"#%1\">").arg(entry->id()) + htmlSubject + "</a></li>";
KJotsBook *book = dynamic_cast<KJotsBook*>(entry);
if ( book ) toc += book->getToc();
@@ -780,20 +780,20 @@ QString KJotsBook::getToc()
\param top Pointer to the "starting point" of this tree.
\param diskMode Files saved to disk have a slightly different format.
*/
-QString KJotsBook::generateHtml( KJotsEntryBase* top, bool diskMode )
+TQString KJotsBook::generateHtml( KJotsEntryBase* top, bool diskMode )
{
- QString toc, body;
- QString htmlTitle = prepForHTML(subject());
+ TQString toc, body;
+ TQString htmlTitle = prepForHTML(subject());
if ( top == this )
{
- toc = QString("<h1><a name=\"%1\">%2</a></h1>").arg(id()).arg(htmlTitle);
+ toc = TQString("<h1><a name=\"%1\">%2</a></h1>").arg(id()).arg(htmlTitle);
} else {
if ( diskMode )
{
- toc = QString("<h2><a name=\"%1\">%2</a></h2>").arg(id()).arg(htmlTitle);
+ toc = TQString("<h2><a name=\"%1\">%2</a></h2>").arg(id()).arg(htmlTitle);
} else {
- toc = QString("<h2><a name=\"%1\" href=\"%2\">%3</a></h2>").arg(id()).arg(id()).arg(htmlTitle);
+ toc = TQString("<h2><a name=\"%1\" href=\"%2\">%3</a></h2>").arg(id()).arg(id()).arg(htmlTitle);
}
}
@@ -818,15 +818,15 @@ QString KJotsBook::generateHtml( KJotsEntryBase* top, bool diskMode )
This functions output moderately formatted text when the user chooses to save as
a text file.
*/
-QString KJotsBook::generateText( void )
+TQString KJotsBook::generateText( void )
{
- QString out;
+ TQString out;
//Print Fancy Text header
- QString line, buf;
+ TQString line, buf;
line.fill('#', subject().length() + 2);
line += "\n";
- out = line + QString("# ") + subject() + QString("\n") + line;
+ out = line + TQString("# ") + subject() + TQString("\n") + line;
KJotsEntryBase* entry = dynamic_cast<KJotsEntryBase*>(firstChild());
while ( entry )
@@ -843,13 +843,13 @@ QString KJotsBook::generateText( void )
// KJotsPage
//
-KJotsPage::KJotsPage(KJotsBook* parent, QListViewItem *after)
+KJotsPage::KJotsPage(KJotsBook* parent, TQListViewItem *after)
: KJotsEntryBase(parent,after),
m_editor(0)
{
m_isBook = false;
m_paraPos = m_indexPos = 0;
- setPixmap(0, kapp->iconLoader()->loadIcon(QString("edit"), KIcon::Small));
+ setPixmap(0, kapp->iconLoader()->loadIcon(TQString("edit"), KIcon::Small));
}
KJotsPage::~KJotsPage()
@@ -879,7 +879,7 @@ void KJotsPage::initNewPage(void)
/*!
\brief Return the text of this page.
*/
-QString KJotsPage::body()
+TQString KJotsPage::body()
{
//if we're being edited we want the current text, not whatever we saved before.
if ( m_editor && m_editor->edited() )
@@ -895,7 +895,7 @@ QString KJotsPage::body()
/*!
\brief Sets the text of this page.
*/
-void KJotsPage::setBody(const QString& text)
+void KJotsPage::setBody(const TQString& text)
{
assert ( !m_editor ); //m_editor should *never* be set.
m_text = text;
@@ -905,7 +905,7 @@ void KJotsPage::rename()
{
bool ok;
- QString name = KInputDialog::getText(i18n( "Rename Page" ),
+ TQString name = KInputDialog::getText(i18n( "Rename Page" ),
i18n( "Page title:" ),
subject(), &ok, listView() );
@@ -926,21 +926,21 @@ void KJotsPage::rename()
\brief Initiated when the user chooses to save this to a file.
This function gets everything ready to go to save to the disk.
*/
-void KJotsPage::saveToFile(KURL url, bool plainText, const QString& encoding)
+void KJotsPage::saveToFile(KURL url, bool plainText, const TQString& encoding)
{
if (url.isEmpty() || m_saveInProgress)
return;
m_saveToPlainText = plainText;
- m_saveEncoding = QTextCodec::codecForName(encoding.ascii());
+ m_saveEncoding = TQTextCodec::codecForName(encoding.ascii());
KIO::TransferJob* job = KIO::put(url, -1, true, false, false);
if (!job)
{
return;
}
- connect(job, SIGNAL(dataReq(KIO::Job*, QByteArray&)), SLOT(saveDataReq(KIO::Job*, QByteArray&)));
- connect(job, SIGNAL(result( KIO::Job *)), SLOT(slotSaveResult( KIO::Job *)));
+ connect(job, TQT_SIGNAL(dataReq(KIO::Job*, TQByteArray&)), TQT_SLOT(saveDataReq(KIO::Job*, TQByteArray&)));
+ connect(job, TQT_SIGNAL(result( KIO::Job *)), TQT_SLOT(slotSaveResult( KIO::Job *)));
m_saveInProgress = true;
}
@@ -950,11 +950,11 @@ void KJotsPage::saveToFile(KURL url, bool plainText, const QString& encoding)
\todo This should be augmented to cycle in case of REALLY long pages.
*/
-void KJotsPage::saveDataReq(KIO::Job* /* job */, QByteArray& data)
+void KJotsPage::saveDataReq(KIO::Job* /* job */, TQByteArray& data)
{
if (!m_saveInProgress) return; //sanity check
- QTextStream stream(data, IO_WriteOnly);
+ TQTextStream stream(data, IO_WriteOnly);
stream.setCodec(m_saveEncoding);
if ( !m_saveToPlainText )
@@ -980,11 +980,11 @@ void KJotsPage::slotSaveResult(KIO::Job *)
/* if (job->error() != 0) {} */
}
-void KJotsPage::print(QFont& defaultFont)
+void KJotsPage::print(TQFont& defaultFont)
{
KJotsEntryBase* book = dynamic_cast<KJotsEntryBase*>(KListViewItem::parent());
- QString docName = book->subject();
+ TQString docName = book->subject();
if (!subject().isNull())
{
docName += ": " + subject();
@@ -997,7 +997,7 @@ void KJotsPage::print(QFont& defaultFont)
if (printer.setup(listView(), i18n("Print: %1").arg(docName)))
{
- QPainter painter( &printer );
+ TQPainter painter( &printer );
painter.setFont(defaultFont);
print(printer, painter, 0);
painter.end();
@@ -1007,26 +1007,26 @@ void KJotsPage::print(QFont& defaultFont)
/*!
\brief Prints this page.
*/
-int KJotsPage::print(KPrinter& printer, QPainter& painter, int y)
+int KJotsPage::print(KPrinter& printer, TQPainter& painter, int y)
{
- QPaintDeviceMetrics metrics( &printer );
+ TQPaintDeviceMetrics metrics( &printer );
int maxWidth = metrics.width();
int maxHeight = metrics.height();
//TODO: Is it really necessary to copy the entire body when printing?
- QStringList paragraphs = QStringList::split(QChar('\n'), body(), true);
+ TQStringList paragraphs = TQStringList::split(TQChar('\n'), body(), true);
y = printTitleBox(subject(), printer, painter, y);
- for (QStringList::iterator para = paragraphs.begin();
+ for (TQStringList::iterator para = paragraphs.begin();
para != paragraphs.end();
++para)
{
//Watch for blank lines inserted as spacers.
if ( (*para).isNull() ) *para = " ";
- QRect r = painter.boundingRect(0, y,
+ TQRect r = painter.boundingRect(0, y,
maxWidth, maxHeight,
- QPainter::ExpandTabs | QPainter::WordBreak,
+ TQPainter::ExpandTabs | TQPainter::WordBreak,
*para);
if ((y + r.height()) > maxHeight)
@@ -1036,7 +1036,7 @@ int KJotsPage::print(KPrinter& printer, QPainter& painter, int y)
}
painter.drawText(0, y, maxWidth, maxHeight - y,
- QPainter::ExpandTabs | QPainter::WordBreak,
+ TQPainter::ExpandTabs | TQPainter::WordBreak,
*para);
y += r.height();
}
@@ -1048,7 +1048,7 @@ int KJotsPage::print(KPrinter& printer, QPainter& painter, int y)
\brief Get the default title of this page.
\note This is only used by initNewPage(); it could probably be removed.
*/
-QString KJotsPage::defaultSubject()
+TQString KJotsPage::defaultSubject()
{
int page = 0;
@@ -1116,15 +1116,15 @@ bool KJotsPage::isDirty()
/*!
\brief Creates XML code and performs necessary tasks to save file.
This function should ONLY be called when saving the file.
-*/void KJotsPage::generateXml( QDomDocument &doc, QDomElement &parent )
+*/void KJotsPage::generateXml( TQDomDocument &doc, TQDomElement &parent )
{
- QDomElement page = doc.createElement( "KJotsPage" );
+ TQDomElement page = doc.createElement( "KJotsPage" );
parent.appendChild( page );
KJotsEntryBase::generateXml(doc, page); //let the base class save important stuff
- QDomElement text = doc.createElement( "Text" );
- QString saveText = body();
+ TQDomElement text = doc.createElement( "Text" );
+ TQString saveText = body();
if ( saveText.contains("]]>") ) {
saveText.replace("]]>","]]&gt;");
text.setAttribute("fixed", "1");
@@ -1138,19 +1138,19 @@ bool KJotsPage::isDirty()
/*!
Parses through XML code from a file.
*/
-void KJotsPage::parseXml( QDomElement &me )
+void KJotsPage::parseXml( TQDomElement &me )
{
if ( me.tagName() == "KJotsPage" )
{
- QDomNode n = me.firstChild();
+ TQDomNode n = me.firstChild();
while( !n.isNull() )
{
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if ( !e.isNull() )
{
if ( e.tagName() == "Text" )
{
- QString bodyText = e.text();
+ TQString bodyText = e.text();
if ( e.hasAttribute("fixed") )
{
bodyText.replace("]]&gt;", "]]>");
@@ -1175,32 +1175,32 @@ void KJotsPage::parseXml( QDomElement &me )
\param top This tells us that we are the toplevel.
\param diskMode Files saved to disk have a slightly different format.
*/
-QString KJotsPage::generateHtml( KJotsEntryBase *top, bool diskMode )
+TQString KJotsPage::generateHtml( KJotsEntryBase *top, bool diskMode )
{
- QString html;
- QString htmlSubject = prepForHTML(subject());
+ TQString html;
+ TQString htmlSubject = prepForHTML(subject());
if ( top == this || diskMode ) {
- html += QString("<h3><a name=\"%1\">%2</a></h3>").arg(id()).arg(htmlSubject);
+ html += TQString("<h3><a name=\"%1\">%2</a></h3>").arg(id()).arg(htmlSubject);
} else {
- html += QString("<h3><a name=\"%1\" href=\"%2\">%3</a></h3>").arg(id()).arg(id()).arg(htmlSubject);
+ html += TQString("<h3><a name=\"%1\" href=\"%2\">%3</a></h3>").arg(id()).arg(id()).arg(htmlSubject);
}
html += prepForHTML(body());
html += "<br><table border=1><tr>";
- html += QString("<td><a href=\"#%1\">%2</a></td>").arg(id()).arg(subject());
+ html += TQString("<td><a href=\"#%1\">%2</a></td>").arg(id()).arg(subject());
if ( top != this )
{
KJotsBook *parent = parentBook();
while ( parent )
{
- html += QString("<td><a href=\"#%1\">%2</a></td>").arg(parent->id()).arg(parent->subject());
+ html += TQString("<td><a href=\"#%1\">%2</a></td>").arg(parent->id()).arg(parent->subject());
if ( parent == top ) break;
parent = parent->parentBook();
}
}
- html += QString("</tr></table>");
+ html += TQString("</tr></table>");
if ( top != this ) html += "<hr>";
return html;
@@ -1213,15 +1213,15 @@ QString KJotsPage::generateHtml( KJotsEntryBase *top, bool diskMode )
This functions output moderately formatted text when the user chooses to save as
a text file.
*/
-QString KJotsPage::generateText( void )
+TQString KJotsPage::generateText( void )
{
- QString out;
+ TQString out;
//Print Fancy Text header
- QString line, buf;
+ TQString line, buf;
line.fill('#', subject().length() + 2);
line += "\n";
- out = line + QString("# ") + subject() + QString("\n") + line;
+ out = line + TQString("# ") + subject() + TQString("\n") + line;
out += body();
diff --git a/kjots/kjotsentry.h b/kjots/kjotsentry.h
index a16d176..08ad403 100644
--- a/kjots/kjotsentry.h
+++ b/kjots/kjotsentry.h
@@ -46,26 +46,26 @@ namespace KIO
class Job;
}
-class KJotsEntryBase : public QObject, public KListViewItem
+class KJotsEntryBase : public TQObject, public KListViewItem
{
Q_OBJECT
public:
- KJotsEntryBase(KListView*, QListViewItem*);
- KJotsEntryBase(KListViewItem*, QListViewItem*);
+ KJotsEntryBase(KListView*, TQListViewItem*);
+ KJotsEntryBase(KListViewItem*, TQListViewItem*);
public:
- virtual void setSubject(const QString&);
- QString subject() { return text(0); }
- void setText(int,const QString&);
- virtual void saveToFile(KURL, bool plainText, const QString& encoding) = 0;
- virtual void print(QFont& defaultFont) = 0;
- virtual int print(KPrinter&, QPainter&, int) = 0;
- virtual QString defaultSubject() = 0; //!< "subject" is the caption name
+ virtual void setSubject(const TQString&);
+ TQString subject() { return text(0); }
+ void setText(int,const TQString&);
+ virtual void saveToFile(KURL, bool plainText, const TQString& encoding) = 0;
+ virtual void print(TQFont& defaultFont) = 0;
+ virtual int print(KPrinter&, TQPainter&, int) = 0;
+ virtual TQString defaultSubject() = 0; //!< "subject" is the caption name
virtual void rename() = 0;
- virtual void generateXml( QDomDocument&, QDomElement& );
- virtual void parseXml( QDomElement& );
- virtual QString generateHtml( KJotsEntryBase*, bool ) = 0;
- virtual QString generateText( void ) = 0;
+ virtual void generateXml( TQDomDocument&, TQDomElement& );
+ virtual void parseXml( TQDomElement& );
+ virtual TQString generateHtml( KJotsEntryBase*, bool ) = 0;
+ virtual TQString generateText( void ) = 0;
void setDirty(bool d) { m_dirty = d; } //!< Toggles the dirty flag.
virtual bool isDirty() { return m_dirty; }; //!< Accessor for dirty flag.
@@ -80,7 +80,7 @@ class KJotsEntryBase : public QObject, public KListViewItem
bool isPage() const { return !m_isBook; }
protected:
- int printTitleBox(QString, KPrinter&, QPainter&, int);
+ int printTitleBox(TQString, KPrinter&, TQPainter&, int);
bool m_saveInProgress; //!< Toggled during a manual disk save.
bool m_isBook; //!< used for speed and code clarity.
@@ -99,39 +99,39 @@ class KJotsBook : public KJotsEntryBase
{
Q_OBJECT
public:
- KJotsBook(KListView*, QListViewItem* after = 0);
- KJotsBook(KListViewItem*, QListViewItem* after = 0);
+ KJotsBook(KListView*, TQListViewItem* after = 0);
+ KJotsBook(KListViewItem*, TQListViewItem* after = 0);
~KJotsBook();
- static bool isBookFile(const QString& book);
- bool openBook(const QString&);
+ static bool isBookFile(const TQString& book);
+ bool openBook(const TQString&);
void saveBook();
void deleteBook();
void rename();
- void saveToFile(KURL, bool plainText, const QString& encoding);
+ void saveToFile(KURL, bool plainText, const TQString& encoding);
KJotsPage* addPage(); //!< Add a new page to this book.
- void print(QFont& defaultFont);
- int print(KPrinter&, QPainter&, int);
+ void print(TQFont& defaultFont);
+ int print(KPrinter&, TQPainter&, int);
bool isDirty();
- QString defaultSubject();
- void generateXml( QDomDocument&, QDomElement& );
- void parseXml( QDomElement& );
- QString generateHtml( KJotsEntryBase*, bool );
- QString generateText( void );
+ TQString defaultSubject();
+ void generateXml( TQDomDocument&, TQDomElement& );
+ void parseXml( TQDomElement& );
+ TQString generateHtml( KJotsEntryBase*, bool );
+ TQString generateText( void );
protected slots:
- void saveDataReq(KIO::Job* job, QByteArray& data);
+ void saveDataReq(KIO::Job* job, TQByteArray& data);
void slotSaveResult(KIO::Job*);
private:
- QString getToc();
- bool loadOldBook(QFile &);
+ TQString getToc();
+ bool loadOldBook(TQFile &);
void init();
bool m_open;
- QString m_fileName;
+ TQString m_fileName;
bool m_saveToPlainText;
- QTextCodec* m_saveEncoding;
+ TQTextCodec* m_saveEncoding;
KProgressDialog* m_saveProgressDialog;
};
@@ -142,33 +142,33 @@ class KJotsPage : public KJotsEntryBase
{
Q_OBJECT
public:
- KJotsPage(KJotsBook* parent, QListViewItem* after = 0);
+ KJotsPage(KJotsBook* parent, TQListViewItem* after = 0);
~KJotsPage();
public:
- QString body();
- void setBody(const QString&);
- void saveToFile(KURL, bool plainText, const QString& encoding);
- void print(QFont& defaultFont);
- int print(KPrinter&, QPainter&, int);
- QString defaultSubject();
+ TQString body();
+ void setBody(const TQString&);
+ void saveToFile(KURL, bool plainText, const TQString& encoding);
+ void print(TQFont& defaultFont);
+ int print(KPrinter&, TQPainter&, int);
+ TQString defaultSubject();
void rename();
void setEditor(KJotsEdit*);
bool isDirty();
- void generateXml( QDomDocument&, QDomElement& );
- void parseXml( QDomElement& );
+ void generateXml( TQDomDocument&, TQDomElement& );
+ void parseXml( TQDomElement& );
void initNewPage(void);
- QString generateHtml( KJotsEntryBase*, bool );
- QString generateText( void );
+ TQString generateHtml( KJotsEntryBase*, bool );
+ TQString generateText( void );
protected slots:
- void saveDataReq(KIO::Job* job, QByteArray& data);
+ void saveDataReq(KIO::Job* job, TQByteArray& data);
void slotSaveResult(KIO::Job*);
private:
- QString m_text;
- QTextCodec* m_saveEncoding;
+ TQString m_text;
+ TQTextCodec* m_saveEncoding;
bool m_saveToPlainText;
KJotsEdit *m_editor; //!< ptr to editor if this is the active subject
int m_paraPos; //< used to remrmber the cursor position
diff --git a/kjots/main.cpp b/kjots/main.cpp
index 4b0c10d..dcee5b9 100644
--- a/kjots/main.cpp
+++ b/kjots/main.cpp
@@ -66,7 +66,7 @@ int main( int argc, char **argv )
config->setGroup("kjots");
if (config->hasKey("EFontFamily")) {
// read old font and create it
- QFont font( config->readEntry("EFontFamily"),
+ TQFont font( config->readEntry("EFontFamily"),
config->readNumEntry("EFontSize", 12),
config->readNumEntry("EFontWeight", 0),
config->readNumEntry("EFontItalic", 0));
@@ -89,7 +89,7 @@ int main( int argc, char **argv )
}
}
- a.setMainWidget( (QWidget *) jots );
+ a.setMainWidget( (TQWidget *) jots );
jots->show();
jots->resize(jots->size());
return a.exec();