Remove additional unneeded tq method conversions

pull/1/head
Timothy Pearson 13 years ago
parent d89e9d5c72
commit 98fe2a53a7

@ -326,7 +326,7 @@ bool Knowit::open(const KURL& fname)
TQFile file(fname.path()); TQFile file(fname.path());
if (!file.open(IO_ReadOnly)) { if (!file.open(IO_ReadOnly)) {
KMessageBox::error(0, i18n("<qt>Cannot open file<br><b>%1</b></qt>") KMessageBox::error(0, i18n("<qt>Cannot open file<br><b>%1</b></qt>")
.tqarg(fname.url())); .arg(fname.url()));
if (filename == fname) if (filename == fname)
filename = ""; filename = "";
return false; return false;
@ -376,7 +376,7 @@ bool Knowit::open(const KURL& fname)
slotNoteChanged(active); slotNoteChanged(active);
Edit->setModified(false); Edit->setModified(false);
actionRecent->addURL(filename); actionRecent->addURL(filename);
slotStatusMsg(i18n("File %1 opened.").tqarg(filename.fileName())); slotStatusMsg(i18n("File %1 opened.").arg(filename.fileName()));
slotActionUpdate(); slotActionUpdate();
file.close(); file.close();
@ -392,7 +392,7 @@ bool Knowit::save(const KURL& fname)
TQFile file(fname.path()); TQFile file(fname.path());
if (!file.open(IO_WriteOnly)) { if (!file.open(IO_WriteOnly)) {
KMessageBox::error(0, i18n("<qt>Cannot save file<br><b>%1</b></qt>") KMessageBox::error(0, i18n("<qt>Cannot save file<br><b>%1</b></qt>")
.tqarg(fname.url())); .arg(fname.url()));
return false; return false;
} }
if (Items->prevItem && Edit->isModified()) if (Items->prevItem && Edit->isModified())
@ -407,7 +407,7 @@ bool Knowit::save(const KURL& fname)
Notes.modified = false; Notes.modified = false;
Edit->setModified(false); Edit->setModified(false);
actionRecent->addURL(filename); actionRecent->addURL(filename);
slotStatusMsg(i18n("File %1 saved.").tqarg(filename.fileName())); slotStatusMsg(i18n("File %1 saved.").arg(filename.fileName()));
if (Options.autosave) if (Options.autosave)
AutosaveTimer->start(Options.autosave * 60 * 1000, true); AutosaveTimer->start(Options.autosave * 60 * 1000, true);
return true; return true;
@ -443,13 +443,13 @@ bool Knowit::queryClose()
else if (Options.unconditionalSave) { else if (Options.unconditionalSave) {
slotFileSave(); slotFileSave();
return shuttingDown = filename.isEmpty() || !modified() || (KMessageBox::questionYesNo(0, return shuttingDown = filename.isEmpty() || !modified() || (KMessageBox::questionYesNo(0,
i18n("<qt>File <b>%1</b><br>\ncannot be saved. Quit anyway?</qt>").tqarg(filename.fileName())) i18n("<qt>File <b>%1</b><br>\ncannot be saved. Quit anyway?</qt>").arg(filename.fileName()))
== KMessageBox::Yes); == KMessageBox::Yes);
} }
else else
switch (KMessageBox::questionYesNoCancel(0, switch (KMessageBox::questionYesNoCancel(0,
i18n("<qt>File <b>%1</b><br>\nwas modified. Do you want to save it?</qt>") i18n("<qt>File <b>%1</b><br>\nwas modified. Do you want to save it?</qt>")
.tqarg(filename.isEmpty() ? Untitled : filename.fileName()))) { .arg(filename.isEmpty() ? Untitled : filename.fileName()))) {
case KMessageBox::Yes: case KMessageBox::Yes:
slotFileSave(); slotFileSave();
return shuttingDown = !modified(); return shuttingDown = !modified();
@ -491,7 +491,7 @@ void Knowit::find(TQListViewItem* start)
} }
it++; it++;
} }
KMessageBox::information(0, i18n("<qt>Sought text:<br><b>%1</b><br>not found.</qt>").tqarg(soughtText)); KMessageBox::information(0, i18n("<qt>Sought text:<br><b>%1</b><br>not found.</qt>").arg(soughtText));
} }
@ -671,7 +671,7 @@ void Knowit::slotNoteRemove()
i18n("<qt>Are you sure you want to delete note<br><b>%1</b><br> " i18n("<qt>Are you sure you want to delete note<br><b>%1</b><br> "
"and its subnotes?</qt>") : "and its subnotes?</qt>") :
i18n("<qt>Are you sure you want to delete note<br><b>%1</b>?</qt>"); i18n("<qt>Are you sure you want to delete note<br><b>%1</b>?</qt>");
if (KMessageBox::questionYesNo(0, msg.tqarg(elt->text(0))) == KMessageBox::Yes) { if (KMessageBox::questionYesNo(0, msg.arg(elt->text(0))) == KMessageBox::Yes) {
TQListViewItem* parent = elt->parent(); TQListViewItem* parent = elt->parent();
Notes.removeNote(elt); Notes.removeNote(elt);
if (!Notes.count()) if (!Notes.count())
@ -884,7 +884,7 @@ void Knowit::slotFileSaveAs()
TQFileInfo fileinfo(url.path()); TQFileInfo fileinfo(url.path());
if (fileinfo.exists() && KMessageBox::questionYesNo(0, if (fileinfo.exists() && KMessageBox::questionYesNo(0,
i18n("<qt>File<br><b>%1</b><br>already exists. Overwrite it?</qt>") i18n("<qt>File<br><b>%1</b><br>already exists. Overwrite it?</qt>")
.tqarg(url.path())) == KMessageBox::No) .arg(url.path())) == KMessageBox::No)
return; return;
save(url); save(url);
} }
@ -901,8 +901,8 @@ void Knowit::slotFileInfo()
} }
KMessageBox::information(0, i18n("<qt><h1>%1</h1>" KMessageBox::information(0, i18n("<qt><h1>%1</h1>"
"Document path: %2<br>" "Document path: %2<br>"
"Number of notes: %3</qt>").tqarg(filename.fileName()) "Number of notes: %3</qt>").arg(filename.fileName())
.tqarg(filename.path()).tqarg(count)); .arg(filename.path()).arg(count));
} }
@ -976,7 +976,7 @@ void Knowit::slotFileExport()
TQFileInfo fileinfo(url.path()); TQFileInfo fileinfo(url.path());
if (fileinfo.exists() && KMessageBox::questionYesNo(0, if (fileinfo.exists() && KMessageBox::questionYesNo(0,
i18n("<qt>File<br><b>%1</b><br>already exists. Overwrite it?</qt>") i18n("<qt>File<br><b>%1</b><br>already exists. Overwrite it?</qt>")
.tqarg(url.path())) == KMessageBox::No) .arg(url.path())) == KMessageBox::No)
return; return;
int choice = ChooserDlg.getChoice(); int choice = ChooserDlg.getChoice();
TQListViewItem* start = (choice & KnowitChooser::SaveAll) ? TQListViewItem* start = (choice & KnowitChooser::SaveAll) ?
@ -985,8 +985,8 @@ void Knowit::slotFileExport()
TQString style; TQString style;
if (choice & KnowitChooser::Style) if (choice & KnowitChooser::Style)
style = TQString("body {font-family: \"%1\"; color: %2; background-color: %3}") style = TQString("body {font-family: \"%1\"; color: %2; background-color: %3}")
.tqarg(Edit->family()).tqarg(Edit->paletteForegroundColor().name()) .arg(Edit->family()).arg(Edit->paletteForegroundColor().name())
.tqarg(Edit->paletteBackgroundColor().name()); .arg(Edit->paletteBackgroundColor().name());
Notes.find(start)->saveHTML(url, origname, style, choice); Notes.find(start)->saveHTML(url, origname, style, choice);
Options.exportFlags = choice; Options.exportFlags = choice;
} }
@ -1114,7 +1114,7 @@ void Knowit::slotEditInsertDate()
Edit->setUnderline(Options.insertDateUnderline); Edit->setUnderline(Options.insertDateUnderline);
Edit->setColor(TQColor(Options.insertDateColor)); Edit->setColor(TQColor(Options.insertDateColor));
Edit->insert(TQString("%1") Edit->insert(TQString("%1")
.tqarg(TQDateTime::currentDateTime().toString(Options.insertDateFormat))); .arg(TQDateTime::currentDateTime().toString(Options.insertDateFormat)));
Edit->setItalic(ii); Edit->setItalic(ii);
Edit->setBold(ib); Edit->setBold(ib);
Edit->setUnderline(iu); Edit->setUnderline(iu);
@ -1134,7 +1134,7 @@ void Knowit::slotEditInsertFile()
TQFile file(url.path()); TQFile file(url.path());
if (!file.open(IO_ReadOnly)) { if (!file.open(IO_ReadOnly)) {
KMessageBox::error(0, i18n("<qt>Cannot open file<br><b>%1</b></qt>") KMessageBox::error(0, i18n("<qt>Cannot open file<br><b>%1</b></qt>")
.tqarg(url.url())); .arg(url.url()));
return; return;
} }
TQTextStream ts(&file); TQTextStream ts(&file);
@ -1165,10 +1165,10 @@ void Knowit::slotEditChanged()
actionBold->setChecked(Edit->bold()); actionBold->setChecked(Edit->bold());
actionItalic->setChecked(Edit->italic()); actionItalic->setChecked(Edit->italic());
actionUnderline->setChecked(Edit->underline()); actionUnderline->setChecked(Edit->underline());
actionEditAlignLeft->setChecked(Edit->tqalignment() == TQt::AlignLeft); actionEditAlignLeft->setChecked(Edit->alignment() == TQt::AlignLeft);
actionEditAlignRight->setChecked(Edit->tqalignment() == TQt::AlignRight); actionEditAlignRight->setChecked(Edit->alignment() == TQt::AlignRight);
actionEditAlignCenter->setChecked(Edit->tqalignment() == TQt::AlignCenter); actionEditAlignCenter->setChecked(Edit->alignment() == TQt::AlignCenter);
actionEditAlignJustify->setChecked(Edit->tqalignment() == TQt::AlignJustify); actionEditAlignJustify->setChecked(Edit->alignment() == TQt::AlignJustify);
} }
void Knowit::slotEditCursorChanged(int, int) void Knowit::slotEditCursorChanged(int, int)
@ -1277,7 +1277,7 @@ void Knowit::slotLinkRemove()
{ {
TQString msg = i18n("<qt>Are you sure you want to remove link:<br><b>%1</b>?</qt>"); TQString msg = i18n("<qt>Are you sure you want to remove link:<br><b>%1</b>?</qt>");
if (Links->currentItem() != -1 && KMessageBox::questionYesNo(0, if (Links->currentItem() != -1 && KMessageBox::questionYesNo(0,
msg.tqarg(Links->currentText())) == KMessageBox::Yes) { msg.arg(Links->currentText())) == KMessageBox::Yes) {
currentNote()->removeLink(Links->currentItem()); currentNote()->removeLink(Links->currentItem());
Links->removeItem(Links->currentItem()); Links->removeItem(Links->currentItem());
if (!Links->count()) if (!Links->count())

@ -180,11 +180,11 @@ class Knowit : public KMainWindow
void slotEditUnderline(); void slotEditUnderline();
/** Changes color of selected/current text */ /** Changes color of selected/current text */
void slotEditColor(); void slotEditColor();
/** Changes vertical tqalignment to superscript */ /** Changes vertical alignment to superscript */
void slotEditSuperscript(); void slotEditSuperscript();
/** Changes vertical tqalignment to subscript */ /** Changes vertical alignment to subscript */
void slotEditSubscript(); void slotEditSubscript();
/** Restores normal vertical tqalignment */ /** Restores normal vertical alignment */
void slotEditNormal(); void slotEditNormal();
/** Prompts for text and shows note containing it */ /** Prompts for text and shows note containing it */
void slotEditFind(); void slotEditFind();

@ -36,7 +36,7 @@ KnowitChooser::KnowitChooser(int flags)
tqlayout->addWidget(notes = new KComboBox(plainPage(), "Notes")); tqlayout->addWidget(notes = new KComboBox(plainPage(), "Notes"));
l1->setBuddy(notes); l1->setBuddy(notes);
notes->insertItem(i18n("All")); notes->insertItem(i18n("All"));
notes->insertItem(i18n("Current with tqchildren")); notes->insertItem(i18n("Current with children"));
notes->insertItem(i18n("Current only")); notes->insertItem(i18n("Current only"));
tqlayout->addWidget(l2 = new TQLabel(i18n("&Encoding:"), plainPage())); tqlayout->addWidget(l2 = new TQLabel(i18n("&Encoding:"), plainPage()));

@ -379,7 +379,7 @@ void KnowitPreferences::slotUpdateDatePreview()
if(insertDateItalicButton->isOn()) str +="<i>"; if(insertDateItalicButton->isOn()) str +="<i>";
if(insertDateUnderlineButton->isOn()) str += "<u>"; if(insertDateUnderlineButton->isOn()) str += "<u>";
str += "<font COLOR=\""+insertDateColorButton->color().name()+"\">"; str += "<font COLOR=\""+insertDateColorButton->color().name()+"\">";
str += TQString("%1").tqarg(TQDateTime::currentDateTime().toString(insertDateFormatEdit->text())); str += TQString("%1").arg(TQDateTime::currentDateTime().toString(insertDateFormatEdit->text()));
str += "</font>"; str += "</font>";
if(insertDateUnderlineButton->isOn()) str += "</u>"; if(insertDateUnderlineButton->isOn()) str += "</u>";
if(insertDateItalicButton->isOn()) str +="</i>"; if(insertDateItalicButton->isOn()) str +="</i>";

@ -51,8 +51,8 @@ TQString TNoteLink::text(int fmt) const
if (fmt == LinkOnly || description.isEmpty()) return link; if (fmt == LinkOnly || description.isEmpty()) return link;
else if (fmt == DescriptionOnly) return description; else if (fmt == DescriptionOnly) return description;
else if (fmt == LinkDescription) else if (fmt == LinkDescription)
return TQString("%1 (%2)").tqarg(link).tqarg(description); return TQString("%1 (%2)").arg(link).arg(description);
else return TQString("%1 (%2)").tqarg(description).tqarg(link); else return TQString("%1 (%2)").arg(description).arg(link);
} }
TQPixmap TNoteLink::icon() const TQPixmap TNoteLink::icon() const
@ -238,7 +238,7 @@ bool TNote::saveHTML(const KURL& fname, const TQString& origname, const TQString
ts << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" ts << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
"<html>\n<head>\n <title>" << i18n("KnowIt document") << "<html>\n<head>\n <title>" << i18n("KnowIt document") <<
TQString("</title>\n <meta http-equiv=\"Content-Type\" " TQString("</title>\n <meta http-equiv=\"Content-Type\" "
"content=\"text/html; charset=%1\">\n").tqarg(ts.codec()->mimeName()); "content=\"text/html; charset=%1\">\n").arg(ts.codec()->mimeName());
if (!style.isEmpty()) if (!style.isEmpty())
ts << " <style type=\"text/css\">\n " << style << "\n </style>\n"; ts << " <style type=\"text/css\">\n " << style << "\n </style>\n";
ts << "</head>\n\n<body>\n"; ts << "</head>\n\n<body>\n";
@ -246,7 +246,7 @@ bool TNote::saveHTML(const KURL& fname, const TQString& origname, const TQString
TQValueVector<int> Depths; TQValueVector<int> Depths;
Depths.append(0); Depths.append(0);
if (flags & TOC) { if (flags & TOC) {
ts << TQString("<h1>%1</h1>\n").tqarg(i18n("Table of contents")); ts << TQString("<h1>%1</h1>\n").arg(i18n("Table of contents"));
saveHTMLTocEntry(ts, Depths, flags); saveHTMLTocEntry(ts, Depths, flags);
ts << "\n\n"; ts << "\n\n";
} }
@ -256,9 +256,9 @@ bool TNote::saveHTML(const KURL& fname, const TQString& origname, const TQString
saveHTMLBuf(ts, Depths, flags); saveHTMLBuf(ts, Depths, flags);
TQString epilog = i18n("Exported from %1 by KnowIt %2, %3."); TQString epilog = i18n("Exported from %1 by KnowIt %2, %3.");
ts << "<br><br><br><small>" << epilog.tqarg(origname) ts << "<br><br><br><small>" << epilog.arg(origname)
.tqarg(VERSION) .arg(VERSION)
.tqarg(TQDateTime::currentDateTime().toString()) << "</small>\n\n"; .arg(TQDateTime::currentDateTime().toString()) << "</small>\n\n";
ts << "</body>\n</html>\n\n"; ts << "</body>\n</html>\n\n";
return true; return true;
} }
@ -272,12 +272,12 @@ bool TNote::saveHTMLBuf(TQTextStream& ts, TQValueVector<int>& depths,
else if (hlevel > 3) hlevel = 3; else if (hlevel > 3) hlevel = 3;
TQString id, number; TQString id, number;
for (uint i=0; i<depths.count(); i++) for (uint i=0; i<depths.count(); i++)
id += TQString("%1.").tqarg(depths[i]); id += TQString("%1.").arg(depths[i]);
if (flags & Enumerate) if (flags & Enumerate)
number = id + " "; number = id + " ";
ts << TQString("<h%1 id=\"S%2\">%3%4</h%5>").tqarg(hlevel).tqarg(id).tqarg(number) ts << TQString("<h%1 id=\"S%2\">%3%4</h%5>").arg(hlevel).arg(id).arg(number)
.tqarg(item->text(0)).tqarg(hlevel); .arg(item->text(0)).arg(hlevel);
TQString htmltext = text; TQString htmltext = text;
int begin = htmltext.find("<body"); int begin = htmltext.find("<body");
if (begin >= 0) begin = htmltext.find(">", begin); if (begin >= 0) begin = htmltext.find(">", begin);
@ -289,14 +289,14 @@ bool TNote::saveHTMLBuf(TQTextStream& ts, TQValueVector<int>& depths,
/* save links */ /* save links */
for (TQValueList<TNoteLink>::Iterator LinkList = links.begin(); for (TQValueList<TNoteLink>::Iterator LinkList = links.begin();
LinkList != links.end(); ++LinkList) LinkList != links.end(); ++LinkList)
ts << TQString("<a href=\"%1\">%2</a><br>\n").tqarg((*LinkList).link) ts << TQString("<a href=\"%1\">%2</a><br>\n").arg((*LinkList).link)
.tqarg((*LinkList).text(TNoteLink::DescriptionOnly)); .arg((*LinkList).text(TNoteLink::DescriptionOnly));
/* save rule */ /* save rule */
if (flags & AddRule) ts << "<hr size=\"1\" noshade>\n\n"; if (flags & AddRule) ts << "<hr size=\"1\" noshade>\n\n";
else ts << "\n\n"; else ts << "\n\n";
/* save tqchildren */ /* save children */
if ((SaveSubnotes | SaveAll) & flags && item->childCount()) { if ((SaveSubnotes | SaveAll) & flags && item->childCount()) {
depths.append(0); depths.append(0);
collection->find(item->firstChild())->saveHTMLBuf(ts, depths, flags); collection->find(item->firstChild())->saveHTMLBuf(ts, depths, flags);
@ -321,11 +321,11 @@ bool TNote::saveHTMLTocEntry(TQTextStream& ts, TQValueVector<int>& depths, int f
TQString id, number; TQString id, number;
for (uint i=0; i<depths.count(); i++) for (uint i=0; i<depths.count(); i++)
id += TQString("%1.").tqarg(depths[i]); id += TQString("%1.").arg(depths[i]);
if (flags & Enumerate) number = id + " "; if (flags & Enumerate) number = id + " ";
ts << space; ts << space;
ts << TQString("<dt><a href=\"#S%1\">%2%3</a></dt>\n").tqarg(id).tqarg(number). ts << TQString("<dt><a href=\"#S%1\">%2%3</a></dt>\n").arg(id).arg(number).
arg(item->text(0)); arg(item->text(0));
if ((SaveSubnotes | SaveAll) & flags && item->childCount()) { if ((SaveSubnotes | SaveAll) & flags && item->childCount()) {
depths.append(0); depths.append(0);
@ -397,9 +397,9 @@ void TNote::save(TQTextStream& ts, bool current)
const TQString activeheader = "\\CurrentEntry %1 %2\n"; const TQString activeheader = "\\CurrentEntry %1 %2\n";
if (current) if (current)
ts << activeheader.tqarg(item->depth()).tqarg(item->text(0)); ts << activeheader.arg(item->depth()).arg(item->text(0));
else else
ts << header.tqarg(item->depth()).tqarg(item->text(0)); ts << header.arg(item->depth()).arg(item->text(0));
for (TQValueList<TNoteLink>::Iterator LinkList = links.begin(); for (TQValueList<TNoteLink>::Iterator LinkList = links.begin();
LinkList != links.end(); ++LinkList) LinkList != links.end(); ++LinkList)
(*LinkList).save(ts); (*LinkList).save(ts);

Loading…
Cancel
Save