rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/basket@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 14284db4df
commit 33f08e9313

@ -49,7 +49,7 @@ bool BasketThumbCreator::create(const TQString &path, int /*width*/, int /*heigh
while (!stream.atEnd()) { while (!stream.atEnd()) {
// Get Key/Value Pair From the Line to Read: // Get Key/Value Pair From the Line to Read:
line = stream.readLine(); line = stream.readLine();
int index = line.tqfind(':'); int index = line.find(':');
TQString key; TQString key;
TQString value; TQString value;
if (index >= 0) { if (index >= 0) {

@ -102,7 +102,7 @@ void Archive::save(Basket *basket, bool withSubBaskets, const TQString &destinat
TQPixmap icon = kapp->iconLoader()->loadIcon(state->emblem(), KIcon::Small, 16, KIcon::DefaultState, /*path_store=*/0L, /*canReturnNull=*/true); TQPixmap icon = kapp->iconLoader()->loadIcon(state->emblem(), KIcon::Small, 16, KIcon::DefaultState, /*path_store=*/0L, /*canReturnNull=*/true);
if (!icon.isNull()) { if (!icon.isNull()) {
icon.save(tempIconFile, "PNG"); icon.save(tempIconFile, "PNG");
TQString iconFileName = state->emblem().tqreplace('/', '_'); TQString iconFileName = state->emblem().replace('/', '_');
tar.addLocalFile(tempIconFile, "tag-emblems/" + iconFileName); tar.addLocalFile(tempIconFile, "tag-emblems/" + iconFileName);
} }
} }
@ -196,13 +196,13 @@ void Archive::saveBasketToArchive(Basket *basket, bool recursive, KTar *tar, TQS
TQPixmap icon = kapp->iconLoader()->loadIcon(basket->icon(), KIcon::Small, 16, KIcon::DefaultState, /*path_store=*/0L, /*canReturnNull=*/true); TQPixmap icon = kapp->iconLoader()->loadIcon(basket->icon(), KIcon::Small, 16, KIcon::DefaultState, /*path_store=*/0L, /*canReturnNull=*/true);
if (!icon.isNull()) { if (!icon.isNull()) {
icon.save(tempIconFile, "PNG"); icon.save(tempIconFile, "PNG");
TQString iconFileName = basket->icon().tqreplace('/', '_'); TQString iconFileName = basket->icon().replace('/', '_');
tar->addLocalFile(tempIconFile, "basket-icons/" + iconFileName); tar->addLocalFile(tempIconFile, "basket-icons/" + iconFileName);
} }
} }
// Save basket backgorund image: // Save basket backgorund image:
TQString imageName = basket->backgroundImageName(); TQString imageName = basket->backgroundImageName();
if (!basket->backgroundImageName().isEmpty() && !backgrounds.tqcontains(imageName)) { if (!basket->backgroundImageName().isEmpty() && !backgrounds.contains(imageName)) {
TQString backgroundPath = Global::backgroundManager->pathForImageName(imageName); TQString backgroundPath = Global::backgroundManager->pathForImageName(imageName);
if (!backgroundPath.isEmpty()) { if (!backgroundPath.isEmpty()) {
// Save the background image: // Save the background image:
@ -267,7 +267,7 @@ void Archive::open(const TQString &path)
while (!stream.atEnd()) { while (!stream.atEnd()) {
// Get Key/Value Pair From the Line to Read: // Get Key/Value Pair From the Line to Read:
line = stream.readLine(); line = stream.readLine();
int index = line.tqfind(':'); int index = line.find(':');
TQString key; TQString key;
TQString value; TQString value;
if (index >= 0) { if (index >= 0) {
@ -306,7 +306,7 @@ void Archive::open(const TQString &path)
delete buffer; delete buffer;
// } // }
} else if (key == "archive*") { } else if (key == "archive*") {
if (version != "0.6.1" && readCompatibleVersions.tqcontains("0.6.1") && !writeCompatibleVersions.tqcontains("0.6.1")) { if (version != "0.6.1" && readCompatibleVersions.contains("0.6.1") && !writeCompatibleVersions.contains("0.6.1")) {
KMessageBox::information( KMessageBox::information(
0, 0,
i18n("This file was created with a recent version of %1. " i18n("This file was created with a recent version of %1. "
@ -317,7 +317,7 @@ void Archive::open(const TQString &path)
i18n("Basket Archive Error") i18n("Basket Archive Error")
); );
} }
if (version != "0.6.1" && !readCompatibleVersions.tqcontains("0.6.1") && !writeCompatibleVersions.tqcontains("0.6.1")) { if (version != "0.6.1" && !readCompatibleVersions.contains("0.6.1") && !writeCompatibleVersions.contains("0.6.1")) {
KMessageBox::error( KMessageBox::error(
0, 0,
i18n("This file was created with a recent version of %1. Please upgrade to a newer version to be able to open that file.") i18n("This file was created with a recent version of %1. Please upgrade to a newer version to be able to open that file.")
@ -437,9 +437,9 @@ void Archive::importTagEmblems(const TQString &extractionFolder)
if (emblem.isNull()) { if (emblem.isNull()) {
// Of the emblem path was eg. "/home/seb/emblem.png", it was exported as "tag-emblems/_home_seb_emblem.png". // Of the emblem path was eg. "/home/seb/emblem.png", it was exported as "tag-emblems/_home_seb_emblem.png".
// So we need to copy that image to "~/.kde/share/apps/basket/tag-emblems/emblem.png": // So we need to copy that image to "~/.kde/share/apps/basket/tag-emblems/emblem.png":
int slashIndex = emblemName.tqfindRev("/"); int slashIndex = emblemName.findRev("/");
TQString emblemFileName = (slashIndex < 0 ? emblemName : emblemName.right(slashIndex - 2)); TQString emblemFileName = (slashIndex < 0 ? emblemName : emblemName.right(slashIndex - 2));
TQString source = extractionFolder + "tag-emblems/" + emblemName.tqreplace('/', '_'); TQString source = extractionFolder + "tag-emblems/" + emblemName.replace('/', '_');
TQString destination = Global::savesFolder() + "tag-emblems/" + emblemFileName; TQString destination = Global::savesFolder() + "tag-emblems/" + emblemFileName;
if (!dir.exists(destination)) if (!dir.exists(destination))
copier.copyFolder(source, destination); copier.copyFolder(source, destination);
@ -555,9 +555,9 @@ void Archive::importBasketIcon(TQDomElement properties, const TQString &extracti
FormatImporter copier; // Only used to copy files synchronously FormatImporter copier; // Only used to copy files synchronously
// Of the icon path was eg. "/home/seb/icon.png", it was exported as "basket-icons/_home_seb_icon.png". // Of the icon path was eg. "/home/seb/icon.png", it was exported as "basket-icons/_home_seb_icon.png".
// So we need to copy that image to "~/.kde/share/apps/basket/basket-icons/icon.png": // So we need to copy that image to "~/.kde/share/apps/basket/basket-icons/icon.png":
int slashIndex = iconName.tqfindRev("/"); int slashIndex = iconName.findRev("/");
TQString iconFileName = (slashIndex < 0 ? iconName : iconName.right(slashIndex - 2)); TQString iconFileName = (slashIndex < 0 ? iconName : iconName.right(slashIndex - 2));
TQString source = extractionFolder + "basket-icons/" + iconName.tqreplace('/', '_'); TQString source = extractionFolder + "basket-icons/" + iconName.replace('/', '_');
TQString destination = Global::savesFolder() + "basket-icons/" + iconFileName; TQString destination = Global::savesFolder() + "basket-icons/" + iconFileName;
if (!dir.exists(destination)) if (!dir.exists(destination))
copier.copyFolder(source, destination); copier.copyFolder(source, destination);
@ -584,7 +584,7 @@ void Archive::renameMergedStates(TQDomNode notes, TQMap<TQString, TQString> &mer
TQStringList tagNames = TQStringList::split(";", tags); TQStringList tagNames = TQStringList::split(";", tags);
for (TQStringList::Iterator it = tagNames.begin(); it != tagNames.end(); ++it) { for (TQStringList::Iterator it = tagNames.begin(); it != tagNames.end(); ++it) {
TQString &tag = *it; TQString &tag = *it;
if (mergedStates.tqcontains(tag)) { if (mergedStates.contains(tag)) {
tag = mergedStates[tag]; tag = mergedStates[tag];
} }
} }

@ -400,7 +400,7 @@ void RestoreThread::run()
tar.open(IO_ReadOnly); tar.open(IO_ReadOnly);
if (tar.isOpened()) { if (tar.isOpened()) {
const KArchiveDirectory *directory = tar.directory(); const KArchiveDirectory *directory = tar.directory();
if (directory->entries().tqcontains(backupMagicFolder)) { if (directory->entries().contains(backupMagicFolder)) {
const KArchiveEntry *entry = directory->entry(backupMagicFolder); const KArchiveEntry *entry = directory->entry(backupMagicFolder);
if (entry->isDirectory()) { if (entry->isDirectory()) {
((const KArchiveDirectory*) entry)->copyTo(m_destFolder); ((const KArchiveDirectory*) entry)->copyTo(m_destFolder);

@ -179,7 +179,7 @@ TQValueList<Note*> NoteSelection::parentGroups()
// For each tqparent groups of the note: // For each tqparent groups of the note:
for (Note *note = node->note->parentNote(); note; note = note->parentNote()) for (Note *note = node->note->parentNote(); note; note = note->parentNote())
// Add it (if it was not already in the list): // Add it (if it was not already in the list):
if (!note->isColumn() && !groups.tqcontains(note)) if (!note->isColumn() && !groups.contains(note))
groups.append(note); groups.append(note);
return groups; return groups;
@ -1505,7 +1505,7 @@ void Basket::contentsMousePressEvent(TQMouseEvent *event)
if (zone == Note::Handle || zone == Note::Group || (zone == Note::GroupExpander && (controlPressed || shiftPressed))) { if (zone == Note::Handle || zone == Note::Group || (zone == Note::GroupExpander && (controlPressed || shiftPressed))) {
Note *end = clicked; Note *end = clicked;
if (clicked->isGroup() && shiftPressed) { if (clicked->isGroup() && shiftPressed) {
if (clicked->tqcontains(m_startOfShiftSelectionNote)) { if (clicked->contains(m_startOfShiftSelectionNote)) {
m_startOfShiftSelectionNote = clicked->firstRealChild(); m_startOfShiftSelectionNote = clicked->firstRealChild();
end = clicked->lastRealChild(); end = clicked->lastRealChild();
} else if (clicked->firstRealChild()->isAfter(m_startOfShiftSelectionNote)) } else if (clicked->firstRealChild()->isAfter(m_startOfShiftSelectionNote))
@ -1904,7 +1904,7 @@ void Basket::contentsDragMoveEvent(TQDragMoveEvent *event)
} }
/* Note *hoveredNote = noteAt(event->pos().x(), event->pos().y()); /* Note *hoveredNote = noteAt(event->pos().x(), event->pos().y());
if ( (isColumnsLayout() && !hoveredNote) || (draggedNotes().tqcontains(hoveredNote)) ) { if ( (isColumnsLayout() && !hoveredNote) || (draggedNotes().contains(hoveredNote)) ) {
event->acceptAction(false); event->acceptAction(false);
event->accept(false); event->accept(false);
} else } else
@ -2683,7 +2683,7 @@ void Basket::doHoverEffects(const TQPoint &pos)
// Ending the drag INSIDE the basket area will make NO hoverEffects() because m_underMouse is false. // Ending the drag INSIDE the basket area will make NO hoverEffects() because m_underMouse is false.
// User need to leave the area and re-enter it to get effects. // User need to leave the area and re-enter it to get effects.
// This hack solve that by dismissing the m_underMouse variable: // This hack solve that by dismissing the m_underMouse variable:
bool underMouse = Global::bnpView->currentBasket() == this && TQRect(contentsX(), contentsY(), visibleWidth(), visibleHeight()).tqcontains(pos); bool underMouse = Global::bnpView->currentBasket() == this && TQRect(contentsX(), contentsY(), visibleWidth(), visibleHeight()).contains(pos);
// Don't do hover effects when a popup menu is opened. // Don't do hover effects when a popup menu is opened.
// Primarily because the basket area will only receive mouseEnterEvent and mouveLeaveEvent. // Primarily because the basket area will only receive mouseEnterEvent and mouveLeaveEvent.
@ -2807,7 +2807,7 @@ void Basket::maybeTip(const TQPoint &pos)
TQRect itRect; TQRect itRect;
for (TQValueList<TQRect>::iterator it = m_blankAreas.begin(); it != m_blankAreas.end(); ++it) { for (TQValueList<TQRect>::iterator it = m_blankAreas.begin(); it != m_blankAreas.end(); ++it) {
itRect = TQRect(0, 0, visibleWidth(), visibleHeight()).intersect(*it); itRect = TQRect(0, 0, visibleWidth(), visibleHeight()).intersect(*it);
if (itRect.tqcontains(contentPos)) { if (itRect.contains(contentPos)) {
rect = itRect; rect = itRect;
rect.moveLeft(rect.left() - contentsX()); rect.moveLeft(rect.left() - contentsX());
rect.moveTop( rect.top() - contentsY()); rect.moveTop( rect.top() - contentsY());
@ -2949,7 +2949,7 @@ Note* Basket::noteAt(int x, int y)
while (note) { while (note) {
possibleNote = note->noteAt(x, y); possibleNote = note->noteAt(x, y);
if (possibleNote) { if (possibleNote) {
if (draggedNotes().tqcontains(possibleNote)) if (draggedNotes().contains(possibleNote))
return 0; return 0;
else else
return possibleNote; return possibleNote;
@ -5130,7 +5130,7 @@ void Basket::removeWatchedFile(const TQString &fullPath)
void Basket::watchedFileModified(const TQString &fullPath) void Basket::watchedFileModified(const TQString &fullPath)
{ {
if (!m_modifiedFiles.tqcontains(fullPath)) if (!m_modifiedFiles.contains(fullPath))
m_modifiedFiles.append(fullPath); m_modifiedFiles.append(fullPath);
// If a big file is saved by an application, notifications are send several times. // If a big file is saved by an application, notifications are send several times.
// We wait they are not sent anymore to considere the file complete! // We wait they are not sent anymore to considere the file complete!
@ -5594,7 +5594,7 @@ void Basket::computeInsertPlace(const TQPoint &cursorPosition)
// Code for rectangular notes : // Code for rectangular notes :
/*TQRect globalRect = it->rect(); /*TQRect globalRect = it->rect();
globalRect.moveTopLeft(it->pos() + contentsY()); globalRect.moveTopLeft(it->pos() + contentsY());
if ( globalRect.tqcontains(curPos) ) { if ( globalRect.contains(curPos) ) {
it->doInterestingThing(); it->doInterestingThing();
}*/ }*/
} }

@ -105,7 +105,7 @@ TQString BasketListViewItem::escapedName(const TQString &string)
{ {
// Underlining the Alt+Letter shortcut (and escape all other '&' characters), if any: // Underlining the Alt+Letter shortcut (and escape all other '&' characters), if any:
TQString basketName = string; TQString basketName = string;
basketName.tqreplace('&', "&&"); // First escape all the amperstamp basketName.replace('&', "&&"); // First escape all the amperstamp
TQString letter; // Find the letter TQString letter; // Find the letter
TQString altKey = /*i18n(*/"Alt"/*)*/; //i18n("The [Alt] key, as shown in shortcuts like Alt+C...", "Alt"); TQString altKey = /*i18n(*/"Alt"/*)*/; //i18n("The [Alt] key, as shown in shortcuts like Alt+C...", "Alt");
TQString shiftKey = /*i18n(*/"Shift"/*)*/; //i18n("The [Shift] key, as shown in shortcuts like Alt+Shift+1...", "Shift"); TQString shiftKey = /*i18n(*/"Shift"/*)*/; //i18n("The [Shift] key, as shown in shortcuts like Alt+Shift+1...", "Shift");
@ -116,7 +116,7 @@ TQString BasketListViewItem::escapedName(const TQString &string)
if (letter.isEmpty() && altShiftLetterExp.search(m_basket->shortcut().toStringInternal()) != -1) if (letter.isEmpty() && altShiftLetterExp.search(m_basket->shortcut().toStringInternal()) != -1)
letter = altShiftLetterExp.cap(1); letter = altShiftLetterExp.cap(1);
if (!letter.isEmpty()) { if (!letter.isEmpty()) {
int index = basketName.tqfind(letter, /*index=*/0, /*caseSensitive=*/false); int index = basketName.find(letter, /*index=*/0, /*caseSensitive=*/false);
if (index != -1) if (index != -1)
basketName.insert(index, '&'); basketName.insert(index, '&');
} }
@ -261,7 +261,7 @@ TQPixmap BasketListViewItem::circledTextPixmap(const TQString &text, int height,
{ {
TQString key = TQString("BLI-%1.%2.%3.%4") TQString key = TQString("BLI-%1.%2.%3.%4")
.tqarg(text).tqarg(height).tqarg(font.toString()).tqarg(color.rgb()); .tqarg(text).tqarg(height).tqarg(font.toString()).tqarg(color.rgb());
if (TQPixmap* cached=TQPixmapCache::tqfind(key)) { if (TQPixmap* cached=TQPixmapCache::find(key)) {
return *cached; return *cached;
} }
@ -467,7 +467,7 @@ void BasketListViewItem::paintCell(TQPainter *painter, const TQColorGroup &/*tqc
.tqarg(m_isUnderDrag) .tqarg(m_isUnderDrag)
.tqarg(m_basket->basketName()) .tqarg(m_basket->basketName())
.tqarg(m_basket->icon()); .tqarg(m_basket->icon());
if (TQPixmap* cached = TQPixmapCache::tqfind(key)) { if (TQPixmap* cached = TQPixmapCache::find(key)) {
// TQt's documentation recommends copying the pointer // TQt's documentation recommends copying the pointer
// into a TQPixmap immediately // into a TQPixmap immediately
TQPixmap cachedBuffer = *cached; TQPixmap cachedBuffer = *cached;
@ -580,7 +580,7 @@ void BasketListViewItem::paintCell(TQPainter *painter, const TQColorGroup &/*tqc
effectiveWidth += countPixmap.width() + MARGIN; effectiveWidth += countPixmap.width() + MARGIN;
} }
if (showLoadingIcon) { if (showLoadingIcon) {
TQPixmap icon = kapp->iconLoader()->loadIcon("tqfind", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/false); TQPixmap icon = kapp->iconLoader()->loadIcon("find", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/false);
thePainter.drawPixmap(effectiveWidth, 0, icon); thePainter.drawPixmap(effectiveWidth, 0, icon);
effectiveWidth += BASKET_ICON_SIZE + MARGIN; effectiveWidth += BASKET_ICON_SIZE + MARGIN;
} }

@ -145,12 +145,12 @@ void BasketStatusBar::setLocktqStatus(bool isLocked)
if (isLocked) { if (isLocked) {
m_locktqStatus->setPixmap(SmallIcon("encrypted.png")); m_locktqStatus->setPixmap(SmallIcon("encrypted.png"));
TQToolTip::add(m_locktqStatus, i18n( TQToolTip::add(m_locktqStatus, i18n(
"<p>This basket is <b>locked</b>.<br>Click to unlock it.</p>").tqreplace(" ", "&nbsp;") ); "<p>This basket is <b>locked</b>.<br>Click to unlock it.</p>").replace(" ", "&nbsp;") );
// TQToolTip::add(m_locktqStatus, i18n("This basket is locked.\nClick to unlock it.")); // TQToolTip::add(m_locktqStatus, i18n("This basket is locked.\nClick to unlock it."));
} else { } else {
m_locktqStatus->clear(); m_locktqStatus->clear();
TQToolTip::add(m_locktqStatus, i18n( TQToolTip::add(m_locktqStatus, i18n(
"<p>This basket is <b>unlocked</b>.<br>Click to lock it.</p>").tqreplace(" ", "&nbsp;") ); "<p>This basket is <b>unlocked</b>.<br>Click to lock it.</p>").replace(" ", "&nbsp;") );
// TQToolTip::add(m_locktqStatus, i18n("This basket is unlocked.\nClick to lock it.")); // TQToolTip::add(m_locktqStatus, i18n("This basket is unlocked.\nClick to lock it."));
} }
} }

@ -597,7 +597,7 @@ void BNPView::setupActions()
actionCollection(), "edit_filter" ); actionCollection(), "edit_filter" );
connect( m_actShowFilter, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(showHideFilterBar(bool)) ); connect( m_actShowFilter, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(showHideFilterBar(bool)) );
m_actFilterAllBaskets = new KToggleAction( i18n("Filter all &Baskets"), "tqfind", "Ctrl+Shift+F", m_actFilterAllBaskets = new KToggleAction( i18n("Filter all &Baskets"), "find", "Ctrl+Shift+F",
actionCollection(), "edit_filter_all_baskets" ); actionCollection(), "edit_filter_all_baskets" );
connect( m_actFilterAllBaskets, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(toggleFilterAllBaskets(bool)) ); connect( m_actFilterAllBaskets, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(toggleFilterAllBaskets(bool)) );
@ -1796,7 +1796,7 @@ void BNPView::saveAsArchive()
KConfig *config = KGlobal::config(); KConfig *config = KGlobal::config();
config->setGroup("Basket Archive"); config->setGroup("Basket Archive");
TQString folder = config->readEntry("lastFolder", TQDir::homeDirPath()) + "/"; TQString folder = config->readEntry("lastFolder", TQDir::homeDirPath()) + "/";
TQString url = folder + TQString(basket->basketName()).tqreplace("/", "_") + ".baskets"; TQString url = folder + TQString(basket->basketName()).replace("/", "_") + ".baskets";
TQString filter = "*.baskets|" + i18n("Basket Archives") + "\n*|" + i18n("All Files"); TQString filter = "*.baskets|" + i18n("Basket Archives") + "\n*|" + i18n("All Files");
TQString destination = url; TQString destination = url;

@ -144,21 +144,21 @@
/// clean up /// clean up
bt.remove( "(no debugging symbols found)..." ); bt.remove( "(no debugging symbols found)..." );
bt.remove( "(no debugging symbols found)\n" ); bt.remove( "(no debugging symbols found)\n" );
bt.tqreplace( TQRegExp("\n{2,}"), "\n" ); //clean up multiple \n characters bt.replace( TQRegExp("\n{2,}"), "\n" ); //clean up multiple \n characters
bt.stripWhiteSpace(); bt.stripWhiteSpace();
/// analyze usefulness /// analyze usefulness
bool useful = true; bool useful = true;
const TQString fileCommandOutput = runCommand( "file `which basket`" ); const TQString fileCommandOutput = runCommand( "file `which basket`" );
if( fileCommandOutput.tqfind( "not stripped", false ) == -1 ) if( fileCommandOutput.find( "not stripped", false ) == -1 )
subject += "[___stripped]"; //same length as below subject += "[___stripped]"; //same length as below
else else
subject += "[NOTstripped]"; subject += "[NOTstripped]";
if( !bt.isEmpty() ) { if( !bt.isEmpty() ) {
const int invalidFrames = bt.tqcontains( TQRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in \\?\\?") ); const int invalidFrames = bt.contains( TQRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in \\?\\?") );
const int validFrames = bt.tqcontains( TQRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in [^?]") ); const int validFrames = bt.contains( TQRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in [^?]") );
const int totalFrames = invalidFrames + validFrames; const int totalFrames = invalidFrames + validFrames;
if( totalFrames > 0 ) { if( totalFrames > 0 ) {
@ -168,7 +168,7 @@
} }
subject += TQString("[frames: %1]").tqarg( totalFrames, 3 /*padding*/ ); subject += TQString("[frames: %1]").tqarg( totalFrames, 3 /*padding*/ );
if( bt.tqfind( TQRegExp(" at \\w*\\.cpp:\\d+\n") ) >= 0 ) if( bt.find( TQRegExp(" at \\w*\\.cpp:\\d+\n") ) >= 0 )
subject += "[line numbers]"; subject += "[line numbers]";
} }
else else

@ -82,7 +82,7 @@ void ExporterDialog::show()
KDialogBase::show(); KDialogBase::show();
TQString lineEditText = m_url->lineEdit()->text(); TQString lineEditText = m_url->lineEdit()->text();
int selectionStart = lineEditText.tqfindRev("/") + 1; int selectionStart = lineEditText.findRev("/") + 1;
m_url->lineEdit()->setSelection(selectionStart, lineEditText.length() - selectionStart - TQString(".html").length()); m_url->lineEdit()->setSelection(selectionStart, lineEditText.length() - selectionStart - TQString(".html").length());
} }
@ -92,7 +92,7 @@ void ExporterDialog::load()
config->setGroup("HTML Export"); config->setGroup("HTML Export");
TQString folder = config->readEntry("lastFolder", TQDir::homeDirPath()) + "/"; TQString folder = config->readEntry("lastFolder", TQDir::homeDirPath()) + "/";
TQString url = folder + TQString(m_basket->basketName()).tqreplace("/", "_") + ".html"; TQString url = folder + TQString(m_basket->basketName()).replace("/", "_") + ".html";
m_url->setURL(url); m_url->setURL(url);
m_embedLinkedFiles->setChecked( config->readBoolEntry("embedLinkedFiles", true) ); m_embedLinkedFiles->setChecked( config->readBoolEntry("embedLinkedFiles", true) );

@ -52,7 +52,7 @@ FilterBar::FilterBar(TQWidget *tqparent, const char *name)
// Create every widgets: // Create every widgets:
TQIconSet resetIconSet = kapp->iconLoader()->loadIconSet("locationbar_erase", KIcon::Toolbar); TQIconSet resetIconSet = kapp->iconLoader()->loadIconSet("locationbar_erase", KIcon::Toolbar);
TQIconSet inAllIconSet = kapp->iconLoader()->loadIconSet("tqfind", KIcon::Toolbar); TQIconSet inAllIconSet = kapp->iconLoader()->loadIconSet("find", KIcon::Toolbar);
m_resetButton = new TQToolButton(this); m_resetButton = new TQToolButton(this);
@ -282,13 +282,13 @@ void FilterBar::tagChanged(int index)
break; break;
default: default:
// Try to find if we are filtering a tag: // Try to find if we are filtering a tag:
TQMapIterator<int, Tag*> it = m_tagsMap.tqfind(index); TQMapIterator<int, Tag*> it = m_tagsMap.find(index);
if (it != m_tagsMap.end()) { if (it != m_tagsMap.end()) {
m_data->tagFilterType = FilterData::TagFilter; m_data->tagFilterType = FilterData::TagFilter;
m_data->tag = *it; m_data->tag = *it;
} else { } else {
// If not, try to find if we are filtering a state: // If not, try to find if we are filtering a state:
TQMapIterator<int, State*> it2 = m_statesMap.tqfind(index); TQMapIterator<int, State*> it2 = m_statesMap.find(index);
if (it2 != m_statesMap.end()) { if (it2 != m_statesMap.end()) {
m_data->tagFilterType = FilterData::StateFilter; m_data->tagFilterType = FilterData::StateFilter;
m_data->state = *it2; m_data->state = *it2;

@ -114,7 +114,7 @@ void FocusedTextEdit::adaptClipboardText(TQClipboard::Mode mode)
if ( (textFormat() == TQt::RichText) && (!clipboard->data(mode)->provides("application/x-qrichtext")) ) { if ( (textFormat() == TQt::RichText) && (!clipboard->data(mode)->provides("application/x-qrichtext")) ) {
TQString text = clipboard->text(mode); TQString text = clipboard->text(mode);
if (text) { if (text) {
text = text.tqreplace("\n", TQChar(0x2028)); text = text.replace("\n", TQChar(0x2028));
clipboard->setText(text, mode); clipboard->setText(text, mode);
} }
} }

@ -114,8 +114,8 @@ void FormatImporter::importBaskets()
if (list.count() > 2) // Pass "." and ".." if (list.count() > 2) // Pass "." and ".."
for (TQStringList::Iterator it = list.begin(); it != list.end(); ++it) // For each folder for (TQStringList::Iterator it = list.begin(); it != list.end(); ++it) // For each folder
if (*it != "." && *it != ".." && dir.exists(Global::savesFolder() + *it + "/.basket")) // If it can be a basket folder if (*it != "." && *it != ".." && dir.exists(Global::savesFolder() + *it + "/.basket")) // If it can be a basket folder
if ( baskets.tqfind((*it) + "/") == baskets.end() && if ( baskets.find((*it) + "/") == baskets.end() &&
baskets.tqfind(*it) == baskets.end() ) // And if it is not already in the imported baskets list baskets.find(*it) == baskets.end() ) // And if it is not already in the imported baskets list
baskets.append(*it); baskets.append(*it);
std::cout << "Import Baskets: Found " << baskets.count() << " baskets to import." << std::endl; std::cout << "Import Baskets: Found " << baskets.count() << " baskets to import." << std::endl;
@ -137,7 +137,7 @@ void FormatImporter::importBaskets()
TQString newFolderName = folderName; TQString newFolderName = folderName;
if (newFolderName.endsWith("/")) if (newFolderName.endsWith("/"))
newFolderName = newFolderName.left(newFolderName.length() - 1); newFolderName = newFolderName.left(newFolderName.length() - 1);
newFolderName = newFolderName.mid(newFolderName.tqfindRev('/') + 1); newFolderName = newFolderName.mid(newFolderName.findRev('/') + 1);
newFolderName = Tools::fileNameForNewFile(newFolderName, Global::basketsFolder()); newFolderName = Tools::fileNameForNewFile(newFolderName, Global::basketsFolder());
FormatImporter f; FormatImporter f;
f.copyFolder(folderName, Global::basketsFolder() + newFolderName); f.copyFolder(folderName, Global::basketsFolder() + newFolderName);

@ -47,7 +47,7 @@ HTMLExporter::HTMLExporter(Basket *basket)
KConfig *config = KGlobal::config(); KConfig *config = KGlobal::config();
config->setGroup("Export to HTML"); config->setGroup("Export to HTML");
TQString folder = config->readEntry("lastFolder", TQDir::homeDirPath()) + "/"; TQString folder = config->readEntry("lastFolder", TQDir::homeDirPath()) + "/";
TQString url = folder + TQString(basket->basketName()).tqreplace("/", "_") + ".html"; TQString url = folder + TQString(basket->basketName()).replace("/", "_") + ".html";
// Ask a file name & path to the user: // Ask a file name & path to the user:
TQString filter = "*.html *.htm|" + i18n("HTML Documents") + "\n*|" + i18n("All Files"); TQString filter = "*.html *.htm|" + i18n("HTML Documents") + "\n*|" + i18n("All Files");
@ -525,8 +525,8 @@ TQString HTMLExporter::copyIcon(const TQString &iconName, int size)
return ""; return "";
// Sometimes icon can be "favicons/www.kde.org", we replace the '/' with a '_' // Sometimes icon can be "favicons/www.kde.org", we replace the '/' with a '_'
TQString fileName = iconName; // TQString::tqreplace() isn't const, so I must copy the string before TQString fileName = iconName; // TQString::replace() isn't const, so I must copy the string before
fileName = "ico" + TQString::number(size) + "_" + fileName.tqreplace("/", "_") + ".png"; fileName = "ico" + TQString::number(size) + "_" + fileName.replace("/", "_") + ".png";
TQString fullPath = iconsFolderPath + fileName; TQString fullPath = iconsFolderPath + fileName;
if (!TQFile::exists(fullPath)) if (!TQFile::exists(fullPath))
DesktopIcon(iconName, size).save(fullPath, "PNG"); DesktopIcon(iconName, size).save(fullPath, "PNG");

@ -685,7 +685,7 @@ bool KColorCombo2::eventFilter(TQObject */*object*/, TQEvent *event)
case TQEvent::MouseButtonDblClick: case TQEvent::MouseButtonDblClick:
case TQEvent::MouseButtonPress: case TQEvent::MouseButtonPress:
mouseEvent = (TQMouseEvent*)event; mouseEvent = (TQMouseEvent*)event;
if ( !TQT_TQRECT_OBJECT(m_popup->rect()).tqcontains(mouseEvent->pos()) ) { if ( !TQT_TQRECT_OBJECT(m_popup->rect()).contains(mouseEvent->pos()) ) {
TQPoint globalPos = m_popup->mapToGlobal(mouseEvent->pos()); TQPoint globalPos = m_popup->mapToGlobal(mouseEvent->pos());
if (TQApplication::widgetAt(globalPos, /*child=*/true) == this) { if (TQApplication::widgetAt(globalPos, /*child=*/true) == this) {
// The popup is being closed by a click on the KColorCombo2 widget. // The popup is being closed by a click on the KColorCombo2 widget.

@ -155,18 +155,18 @@ TQString KGpgMe::checkForUtf8(TQString txt)
for(s = txt.ascii(); *s && !(*s & 0x80); s++) for(s = txt.ascii(); *s && !(*s & 0x80); s++)
; ;
if (*s && !strchr (txt.ascii(), 0xc3) && (txt.tqfind("\\x")==-1)) if (*s && !strchr (txt.ascii(), 0xc3) && (txt.find("\\x")==-1))
return txt; return txt;
// The string is not in UTF-8 // The string is not in UTF-8
//if (strchr (txt.ascii(), 0xc3)) return (txt+" +++"); //if (strchr (txt.ascii(), 0xc3)) return (txt+" +++");
if (txt.tqfind("\\x")==-1) if (txt.find("\\x")==-1)
return TQString::fromUtf8(txt.ascii()); return TQString::fromUtf8(txt.ascii());
// if (!strchr (txt.ascii(), 0xc3) || (txt.tqfind("\\x")!=-1)) { // if (!strchr (txt.ascii(), 0xc3) || (txt.find("\\x")!=-1)) {
for(int idx = 0 ; (idx = txt.tqfind( "\\x", idx )) >= 0 ; ++idx) { for(int idx = 0 ; (idx = txt.find( "\\x", idx )) >= 0 ; ++idx) {
char str[2] = "x"; char str[2] = "x";
str[0] = (char)TQString(txt.mid(idx + 2, 2)).toShort(0, 16); str[0] = (char)TQString(txt.mid(idx + 2, 2)).toShort(0, 16);
txt.tqreplace(idx, 4, str); txt.replace(idx, 4, str);
} }
if (!strchr (txt.ascii(), 0xc3)) if (!strchr (txt.ascii(), 0xc3))
return TQString::fromUtf8(txt.ascii()); return TQString::fromUtf8(txt.ascii());
@ -361,7 +361,7 @@ bool KGpgMe::isGnuPGAgentAvailable()
{ {
TQString agent_info = getenv("GPG_AGENT_INFO"); TQString agent_info = getenv("GPG_AGENT_INFO");
if (agent_info.tqfind(':') > 0) if (agent_info.find(':') > 0)
return true; return true;
return false; return false;
} }
@ -375,7 +375,7 @@ void KGpgMe::setPassphraseCb()
if(m_useGnuPGAgent) if(m_useGnuPGAgent)
{ {
if (agent_info.tqfind(':')) if (agent_info.find(':'))
agent = true; agent = true;
if(agent_info.startsWith("disable:")) if(agent_info.startsWith("disable:"))
setenv("GPG_AGENT_INFO", agent_info.mid(8), 1); setenv("GPG_AGENT_INFO", agent_info.mid(8), 1);

@ -323,7 +323,7 @@ void KIconDialog::slotOk()
TQString key = !d->custom.isEmpty() ? d->custom : d->ui->iconCanvas->getCurrent(); TQString key = !d->custom.isEmpty() ? d->custom : d->ui->iconCanvas->getCurrent();
// Append to list of recent icons // Append to list of recent icons
if (!d->recentList.tqcontains(key)) if (!d->recentList.contains(key))
{ {
d->recentList.push_back(key); d->recentList.push_back(key);

@ -568,11 +568,11 @@ void LikeBack::askEmailAddress()
// FIXME: Should be moved to KAboutData? Cigogne will also need it. // FIXME: Should be moved to KAboutData? Cigogne will also need it.
bool LikeBack::isDevelopmentVersion(const TQString &version) bool LikeBack::isDevelopmentVersion(const TQString &version)
{ {
return version.tqfind("alpha", /*index=*/0, /*caseSensitive=*/false) != -1 || return version.find("alpha", /*index=*/0, /*caseSensitive=*/false) != -1 ||
version.tqfind("beta", /*index=*/0, /*caseSensitive=*/false) != -1 || version.find("beta", /*index=*/0, /*caseSensitive=*/false) != -1 ||
version.tqfind("rc", /*index=*/0, /*caseSensitive=*/false) != -1 || version.find("rc", /*index=*/0, /*caseSensitive=*/false) != -1 ||
version.tqfind("svn", /*index=*/0, /*caseSensitive=*/false) != -1 || version.find("svn", /*index=*/0, /*caseSensitive=*/false) != -1 ||
version.tqfind("cvs", /*index=*/0, /*caseSensitive=*/false) != -1; version.find("cvs", /*index=*/0, /*caseSensitive=*/false) != -1;
} }
/** /**

@ -445,7 +445,7 @@ bool Note::isAfter(Note *note)
return true; return true;
} }
bool Note::tqcontains(Note *note) bool Note::contains(Note *note)
{ {
// if (this == note) // if (this == note)
// return true; // return true;
@ -457,7 +457,7 @@ bool Note::tqcontains(Note *note)
note = note->parentNote(); note = note->parentNote();
// FOR_EACH_CHILD (child) // FOR_EACH_CHILD (child)
// if (child->tqcontains(note)) // if (child->contains(note))
// return true; // return true;
return false; return false;
} }
@ -959,7 +959,7 @@ void Note::toggleFolded(bool animate)
{ {
// Close the editor if it was editing a note that we are about to hide after collapsing: // Close the editor if it was editing a note that we are about to hide after collapsing:
if (!m_isFolded && basket() && basket()->isDuringEdit()) { if (!m_isFolded && basket() && basket()->isDuringEdit()) {
if (tqcontains(basket()->editedNote()) && firstRealChild() != basket()->editedNote()) if (contains(basket()->editedNote()) && firstRealChild() != basket()->editedNote())
basket()->closeEditor(); basket()->closeEditor();
} }
@ -1031,7 +1031,7 @@ Note* Note::noteAt(int x, int y)
recomputeAreas(); recomputeAreas();
for (TQValueList<TQRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) { for (TQValueList<TQRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
TQRect &rect = *it; TQRect &rect = *it;
if (rect.tqcontains(x, y)) if (rect.contains(x, y))
return this; return this;
} }
} }
@ -1043,7 +1043,7 @@ Note* Note::noteAt(int x, int y)
recomputeAreas(); recomputeAreas();
for (TQValueList<TQRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) { for (TQValueList<TQRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
TQRect &rect = *it; TQRect &rect = *it;
if (rect.tqcontains(x, y)) if (rect.contains(x, y))
return this; return this;
} }
return NULL; return NULL;
@ -1065,7 +1065,7 @@ Note* Note::noteAt(int x, int y)
recomputeAreas(); recomputeAreas();
for (TQValueList<TQRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) { for (TQValueList<TQRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
TQRect &rect = *it; TQRect &rect = *it;
if (rect.tqcontains(x, y)) if (rect.contains(x, y))
return this; return this;
} }
return NULL; return NULL;
@ -1667,7 +1667,7 @@ void substractRectOnAreas(const TQRect &rectToSubstract, TQValueList<TQRect> &ar
rect.setRight(rectToSubstract.right()); rect.setRight(rectToSubstract.right());
} }
// Remove the rectangle if it's entirely contained: // Remove the rectangle if it's entirely contained:
if (andRemove && rectToSubstract.tqcontains(rect)) if (andRemove && rectToSubstract.contains(rect))
it = areas.remove(it); it = areas.remove(it);
else else
++it; ++it;
@ -2181,7 +2181,7 @@ bool Note::removedStates(const TQValueList<State*> &deletedStates)
void Note::addTag(Tag *tag) void Note::addTag(Tag *tag)
{ {
addState(tag->states().first(), /*but do not tqreplace:*/false); addState(tag->states().first(), /*but do not replace:*/false);
} }
void Note::removeState(State *state) void Note::removeState(State *state)
@ -2454,7 +2454,7 @@ void Note::listUsedTags(TQValueList<Tag*> &list)
{ {
for (State::List::Iterator it = m_states.begin(); it != m_states.end(); ++it) { for (State::List::Iterator it = m_states.begin(); it != m_states.end(); ++it) {
Tag *tag = (*it)->parentTag(); Tag *tag = (*it)->parentTag();
if (!list.tqcontains(tag)) if (!list.contains(tag))
list.append(tag); list.append(tag);
} }
@ -2467,7 +2467,7 @@ void Note::usedStates(TQValueList<State*> &states)
{ {
if (content()) if (content())
for (State::List::Iterator it = m_states.begin(); it != m_states.end(); ++it) for (State::List::Iterator it = m_states.begin(); it != m_states.end(); ++it)
if (!states.tqcontains(*it)) if (!states.contains(*it))
states.append(*it); states.append(*it);
FOR_EACH_CHILD (child) FOR_EACH_CHILD (child)

@ -131,7 +131,7 @@ class Note
Note* lastSibling(); Note* lastSibling();
int yExpander(); int yExpander();
bool isAfter(Note *note); bool isAfter(Note *note);
bool tqcontains(Note *note); bool contains(Note *note);
/// NOTES VARIOUS PROPERTIES: // CONTENT MANAGEMENT? /// NOTES VARIOUS PROPERTIES: // CONTENT MANAGEMENT?
private: private:

@ -309,16 +309,16 @@ TQString LauncherContent::saveAsFilters() { return "application/x-desktop"; }
TQString ColorContent::saveAsFilters() { return ""; } TQString ColorContent::saveAsFilters() { return ""; }
TQString UnknownContent::saveAsFilters() { return ""; } TQString UnknownContent::saveAsFilters() { return ""; }
bool TextContent::match(const FilterData &data) { return (text().tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); } bool TextContent::match(const FilterData &data) { return (text().find(data.string, /*index=*/0, /*cs=*/false) != -1); }
bool HtmlContent::match(const FilterData &data) { return (m_textEquivalent/*toText("")*/.tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); } //OPTIM_FILTER bool HtmlContent::match(const FilterData &data) { return (m_textEquivalent/*toText("")*/.find(data.string, /*index=*/0, /*cs=*/false) != -1); } //OPTIM_FILTER
bool ImageContent::match(const FilterData &/*data*/) { return false; } bool ImageContent::match(const FilterData &/*data*/) { return false; }
bool AnimationContent::match(const FilterData &/*data*/) { return false; } bool AnimationContent::match(const FilterData &/*data*/) { return false; }
bool SoundContent::match(const FilterData &data) { return (fileName().tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); } bool SoundContent::match(const FilterData &data) { return (fileName().find(data.string, /*index=*/0, /*cs=*/false) != -1); }
bool FileContent::match(const FilterData &data) { return (fileName().tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); } bool FileContent::match(const FilterData &data) { return (fileName().find(data.string, /*index=*/0, /*cs=*/false) != -1); }
bool LinkContent::match(const FilterData &data) { return (title().tqfind(data.string, 0, false) != -1 || url().prettyURL().tqfind(data.string, 0, false) != -1); } bool LinkContent::match(const FilterData &data) { return (title().find(data.string, 0, false) != -1 || url().prettyURL().find(data.string, 0, false) != -1); }
bool LauncherContent::match(const FilterData &data) { return (exec().tqfind(data.string, 0, false) != -1 || name().tqfind(data.string, 0, false) != -1); } bool LauncherContent::match(const FilterData &data) { return (exec().find(data.string, 0, false) != -1 || name().find(data.string, 0, false) != -1); }
bool ColorContent::match(const FilterData &data) { return (TQString(color().name()).tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); } bool ColorContent::match(const FilterData &data) { return (TQString(color().name()).find(data.string, /*index=*/0, /*cs=*/false) != -1); }
bool UnknownContent::match(const FilterData &data) { return (mimeTypes().tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); } bool UnknownContent::match(const FilterData &data) { return (mimeTypes().find(data.string, /*index=*/0, /*cs=*/false) != -1); }
TQString TextContent::editToolTipText() { return i18n("Edit this plain text"); } TQString TextContent::editToolTipText() { return i18n("Edit this plain text"); }
TQString HtmlContent::editToolTipText() { return i18n("Edit this text"); } TQString HtmlContent::editToolTipText() { return i18n("Edit this text"); }
@ -600,8 +600,8 @@ void TextContent::exportToHTML(HTMLExporter *exporter, int indent)
{ {
TQString spaces; TQString spaces;
TQString html = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" + TQString html = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" +
Tools::tagURLs(Tools::textToHTMLWithoutP(text().tqreplace("\t", " "))); // Don't collapse multiple spaces! Tools::tagURLs(Tools::textToHTMLWithoutP(text().replace("\t", " "))); // Don't collapse multiple spaces!
exporter->stream << html.tqreplace(" ", " &nbsp;").tqreplace("\n", "\n" + spaces.fill(' ', indent + 1)); exporter->stream << html.replace(" ", " &nbsp;").replace("\n", "\n" + spaces.fill(' ', indent + 1));
} }
/** class HtmlContent: /** class HtmlContent:
@ -708,9 +708,9 @@ void HtmlContent::setHtml(const TQString &html, bool lazyLoad)
void HtmlContent::exportToHTML(HTMLExporter *exporter, int indent) void HtmlContent::exportToHTML(HTMLExporter *exporter, int indent)
{ {
TQString spaces; TQString spaces;
exporter->stream << Tools::htmlToParagraph(Tools::tagURLs(html().tqreplace("\t", " "))) exporter->stream << Tools::htmlToParagraph(Tools::tagURLs(html().replace("\t", " ")))
.tqreplace(" ", " &nbsp;") .replace(" ", " &nbsp;")
.tqreplace("\n", "\n" + spaces.fill(' ', indent + 1)); .replace("\n", "\n" + spaces.fill(' ', indent + 1));
} }
/** class ImageContent: /** class ImageContent:
@ -1144,7 +1144,7 @@ void FileContent::exportToHTML(HTMLExporter *exporter, int indent)
{ {
TQString spaces; TQString spaces;
TQString fileName = exporter->copyFile(fullPath(), true); TQString fileName = exporter->copyFile(fullPath(), true);
exporter->stream << m_linkDisplay.toHtml(exporter, KURL(exporter->dataFolderName + fileName), "").tqreplace("\n", "\n" + spaces.fill(' ', indent + 1)); exporter->stream << m_linkDisplay.toHtml(exporter, KURL(exporter->dataFolderName + fileName), "").replace("\n", "\n" + spaces.fill(' ', indent + 1));
} }
/** class SoundContent: /** class SoundContent:
@ -1388,7 +1388,7 @@ void LinkContent::exportToHTML(HTMLExporter *exporter, int indent)
*/ */
TQString spaces; TQString spaces;
exporter->stream << m_linkDisplay.toHtml(exporter, linkURL, linkTitle).tqreplace("\n", "\n" + spaces.fill(' ', indent + 1)); exporter->stream << m_linkDisplay.toHtml(exporter, linkURL, linkTitle).replace("\n", "\n" + spaces.fill(' ', indent + 1));
} }
/** class LauncherContent: /** class LauncherContent:
@ -1505,7 +1505,7 @@ void LauncherContent::exportToHTML(HTMLExporter *exporter, int indent)
{ {
TQString spaces; TQString spaces;
TQString fileName = exporter->copyFile(fullPath(), /*createIt=*/true); TQString fileName = exporter->copyFile(fullPath(), /*createIt=*/true);
exporter->stream << m_linkDisplay.toHtml(exporter, KURL(exporter->dataFolderName + fileName), "").tqreplace("\n", "\n" + spaces.fill(' ', indent + 1)); exporter->stream << m_linkDisplay.toHtml(exporter, KURL(exporter->dataFolderName + fileName), "").replace("\n", "\n" + spaces.fill(' ', indent + 1));
} }
/** class ColorContent: /** class ColorContent:
@ -1907,7 +1907,7 @@ void UnknownContent::addAlternateDragObjects(KMultipleDrag *dragObject)
void UnknownContent::exportToHTML(HTMLExporter *exporter, int indent) void UnknownContent::exportToHTML(HTMLExporter *exporter, int indent)
{ {
TQString spaces; TQString spaces;
exporter->stream << "<div class=\"unknown\">" << mimeTypes().tqreplace("\n", "\n" + spaces.fill(' ', indent + 1 + 1)) << "</div>"; exporter->stream << "<div class=\"unknown\">" << mimeTypes().replace("\n", "\n" + spaces.fill(' ', indent + 1 + 1)) << "</div>";
} }

@ -596,7 +596,7 @@ class UnknownContent : public NoteContent
// Open Content or File: // Open Content or File:
KURL urlToOpen(bool /*with*/) { return KURL(); } KURL urlToOpen(bool /*with*/) { return KURL(); }
// Content-Specific Methods: // Content-Specific Methods:
TQString mimeTypes() { return m_mimeTypes; } /// << @return the list of MIME types this note-content tqcontains. TQString mimeTypes() { return m_mimeTypes; } /// << @return the list of MIME types this note-content contains.
protected: protected:
TQString m_mimeTypes; TQString m_mimeTypes;
static const int DECORATION_MARGIN; static const int DECORATION_MARGIN;

@ -922,7 +922,7 @@ TQString NoteFactory::iconForCommand(const TQString &command)
// 1. Use first word as icon (typically the program without argument) // 1. Use first word as icon (typically the program without argument)
icon = TQStringList::split(' ', command).first(); icon = TQStringList::split(' ', command).first();
// 2. If the command is a full path, take only the program file name // 2. If the command is a full path, take only the program file name
icon = icon.mid(icon.tqfindRev('/') + 1); // strip path if given [But it doesn't care of such icon = icon.mid(icon.findRev('/') + 1); // strip path if given [But it doesn't care of such
// "myprogram /my/path/argument" -> return "argument". Would // "myprogram /my/path/argument" -> return "argument". Would
// must first strip first word and then strip path... Useful ?? // must first strip first word and then strip path... Useful ??
// 3. Use characters before any '-' (e.g. use "gimp" icon if run command is "gimp-1.3") // 3. Use characters before any '-' (e.g. use "gimp" icon if run command is "gimp-1.3")

@ -60,7 +60,7 @@ TQString PasswordDlg::key() const
TQString s = w->keyCombo->currentText(); TQString s = w->keyCombo->currentText();
if(s.length() < 16) if(s.length() < 16)
return ""; return "";
int n = s.tqfindRev(' '); int n = s.findRev(' ');
if(n < 0) if(n < 0)
return ""; return "";
return s.mid(n+1); return s.mid(n+1);
@ -75,7 +75,7 @@ void PasswordDlg::setKey(const TQString& key)
{ {
for(int i = 0; i < w->keyCombo->count(); ++i) for(int i = 0; i < w->keyCombo->count(); ++i)
{ {
if(w->keyCombo->text(i).tqfind(key) >= 0) if(w->keyCombo->text(i).find(key) >= 0)
{ {
w->keyCombo->setCurrentItem(i); w->keyCombo->setCurrentItem(i);
return; return;

@ -62,7 +62,7 @@ void SizeTip::positionTip( const TQRect &rect )
TQRect deskR = KGlobalSettings::desktopGeometry( TQPoint( 0, 0 ) ); TQRect deskR = KGlobalSettings::desktopGeometry( TQPoint( 0, 0 ) );
tipRect.moveCenter( TQPoint( deskR.width()/2, deskR.height()/2 ) ); tipRect.moveCenter( TQPoint( deskR.width()/2, deskR.height()/2 ) );
if ( !rect.tqcontains( tipRect, true ) && rect.intersects( tipRect ) ) if ( !rect.contains( tipRect, true ) && rect.intersects( tipRect ) )
tipRect.moveBottomRight( tqgeometry().bottomRight() ); tipRect.moveBottomRight( tqgeometry().bottomRight() );
} }

@ -132,15 +132,15 @@ TQString SoftwareImporters::fromICS(const TQString &ics)
// Remove escaped '\' characters and append the text to the body // Remove escaped '\' characters and append the text to the body
int pos = 0; int pos = 0;
while ( (pos = result.tqfind('\\', pos)) != -1 ) { while ( (pos = result.find('\\', pos)) != -1 ) {
if ((uint)pos == result.length() - 1) // End of string if ((uint)pos == result.length() - 1) // End of string
break; break;
if (result[pos+1] == 'n') { if (result[pos+1] == 'n') {
result.tqreplace(pos, 2, '\n'); result.replace(pos, 2, '\n');
} else if (result[pos+1] == 'r') { } else if (result[pos+1] == 'r') {
result.tqreplace(pos, 2, '\r'); result.replace(pos, 2, '\r');
} else if (result[pos+1] == 't') { } else if (result[pos+1] == 't') {
result.tqreplace(pos, 2, '\t'); result.replace(pos, 2, '\t');
} else if (result[pos] == '\\') { } else if (result[pos] == '\\') {
result.remove(pos, 1); // Take care of "\\", "\,", "\;" and other escaped characters I haven't noticed result.remove(pos, 1); // Take care of "\\", "\,", "\;" and other escaped characters I haven't noticed
++pos; ++pos;
@ -153,34 +153,34 @@ TQString SoftwareImporters::fromICS(const TQString &ics)
TQString SoftwareImporters::fromTomboy(TQString tomboy) TQString SoftwareImporters::fromTomboy(TQString tomboy)
{ {
// The first line is the note title, and we already have it, so we remove it (yes, that's pretty stupid to duplicate it in the content...): // The first line is the note title, and we already have it, so we remove it (yes, that's pretty stupid to duplicate it in the content...):
tomboy = tomboy.mid(tomboy.tqfind("\n")).stripWhiteSpace(); tomboy = tomboy.mid(tomboy.find("\n")).stripWhiteSpace();
// Font styles and decorations: // Font styles and decorations:
tomboy.tqreplace("<bold>", "<b>"); tomboy.replace("<bold>", "<b>");
tomboy.tqreplace("</bold>", "</b>"); tomboy.replace("</bold>", "</b>");
tomboy.tqreplace("<italic>", "<i>"); tomboy.replace("<italic>", "<i>");
tomboy.tqreplace("</italic>", "</i>"); tomboy.replace("</italic>", "</i>");
tomboy.tqreplace("<strikethrough>", "<span style='text-decoration: line-through'>"); tomboy.replace("<strikethrough>", "<span style='text-decoration: line-through'>");
tomboy.tqreplace("</strikethrough>", "</span>"); tomboy.replace("</strikethrough>", "</span>");
// Highlight not supported by TQTextEdit: // Highlight not supported by TQTextEdit:
tomboy.tqreplace("<highlight>", "<span style='color:#ff0080'>"); tomboy.replace("<highlight>", "<span style='color:#ff0080'>");
tomboy.tqreplace("</highlight>", "</span>"); tomboy.replace("</highlight>", "</span>");
// Font sizes: // Font sizes:
tomboy.tqreplace("<size:small>", "<span style='font-size: 7pt'>"); tomboy.replace("<size:small>", "<span style='font-size: 7pt'>");
tomboy.tqreplace("</size:small>", "</span>"); tomboy.replace("</size:small>", "</span>");
tomboy.tqreplace("<size:large>", "<span style='font-size: 16pt'>"); tomboy.replace("<size:large>", "<span style='font-size: 16pt'>");
tomboy.tqreplace("</size:large>", "</span>"); tomboy.replace("</size:large>", "</span>");
tomboy.tqreplace("<size:huge>", "<span style='font-size: 20pt'>"); tomboy.replace("<size:huge>", "<span style='font-size: 20pt'>");
tomboy.tqreplace("</size:huge>", "</span>"); tomboy.replace("</size:huge>", "</span>");
// Internal links to other notes aren't supported yet by BasKet Note Pads: // Internal links to other notes aren't supported yet by BasKet Note Pads:
tomboy.tqreplace("<link:internal>", ""); tomboy.replace("<link:internal>", "");
tomboy.tqreplace("</link:internal>", ""); tomboy.replace("</link:internal>", "");
// In the Tomboy file, new lines are "\n" and not "<br>": // In the Tomboy file, new lines are "\n" and not "<br>":
tomboy.tqreplace("\n", "<br>\n"); tomboy.replace("\n", "<br>\n");
// Preserve consecutive spaces: // Preserve consecutive spaces:
return "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" + tomboy + "</body></html>"; return "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" + tomboy + "</body></html>";
@ -264,7 +264,7 @@ void SoftwareImporters::importKJots()
} else if (buf.left(3) != "\\ID") { // Don't care of the ID } else if (buf.left(3) != "\\ID") { // Don't care of the ID
// Remove escaped '\' characters and append the text to the body // Remove escaped '\' characters and append the text to the body
int pos = 0; int pos = 0;
while ( (pos = buf.tqfind('\\', pos)) != -1 ) while ( (pos = buf.find('\\', pos)) != -1 )
if (buf[++pos] == '\\') if (buf[++pos] == '\\')
buf.remove(pos, 1); buf.remove(pos, 1);
body.append(buf + "\n"); body.append(buf + "\n");
@ -379,7 +379,7 @@ void SoftwareImporters::importStickyNotes()
TQStringList list = dir.entryList(); TQStringList list = dir.entryList();
for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // For each folder for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // For each folder
if ( (*it).tqcontains("gnome", false) ) { if ( (*it).contains("gnome", false) ) {
TQString fullPath = TQDir::home().absPath() + "/" + (*it) + "/stickynotes_applet"; TQString fullPath = TQDir::home().absPath() + "/" + (*it) + "/stickynotes_applet";
if (dir.exists(fullPath)) if (dir.exists(fullPath))
founds += fullPath; founds += fullPath;
@ -457,9 +457,9 @@ void SoftwareImporters::importTomboy()
// Isolate "<note-content version="0.1">CONTENT</note-content>"! // Isolate "<note-content version="0.1">CONTENT</note-content>"!
TQString xml = loadUtf8FileToString(dirPath + *it); TQString xml = loadUtf8FileToString(dirPath + *it);
xml = xml.mid(xml.tqfind("<note-content ")); xml = xml.mid(xml.find("<note-content "));
xml = xml.mid(xml.tqfind(">") + 1); xml = xml.mid(xml.find(">") + 1);
xml = xml.mid(0, xml.tqfind("</note-content>")); xml = xml.mid(0, xml.find("</note-content>"));
if (!title.isEmpty() && !/*content*/xml.isEmpty()) if (!title.isEmpty() && !/*content*/xml.isEmpty())
insertTitledNote(basket, title, fromTomboy(xml/*content*/), TQt::RichText); insertTitledNote(basket, title, fromTomboy(xml/*content*/), TQt::RichText);
@ -598,8 +598,8 @@ void SoftwareImporters::importKnowIt()
if(stream.atEnd()) if(stream.atEnd())
break; break;
int i = line.tqfind("Entry") + 6; int i = line.find("Entry") + 6;
int n = line.tqfind(' ', i); int n = line.find(' ', i);
level = line.mid(i, n - i).toInt(); level = line.mid(i, n - i).toInt();
name = line.mid(n+1); name = line.mid(n+1);
text = ""; text = "";

@ -107,8 +107,8 @@ void KSystemTray2::displayCloseMessage(TQString fileMenu)
// out of screen. // out of screen.
if (useSystray) { if (useSystray) {
TQRect deskRect(0, 0, desktopWidth, desktopHeight); TQRect deskRect(0, 0, desktopWidth, desktopHeight);
if ( !deskRect.tqcontains(g.x(), g.y()) || if ( !deskRect.contains(g.x(), g.y()) ||
!deskRect.tqcontains(g.x() + tw, g.y() + th) ) !deskRect.contains(g.x() + tw, g.y() + th) )
useSystray = false; useSystray = false;
} }
@ -297,7 +297,7 @@ void SystemTray::mouseReleaseEvent(TQMouseEvent *event)
{ {
m_canDrag = false; m_canDrag = false;
if (event->button() == Qt::LeftButton) // Show / hide main window if (event->button() == Qt::LeftButton) // Show / hide main window
if ( TQT_TQRECT_OBJECT(rect()).tqcontains(event->pos()) ) { // Accept only if released in systemTray if ( TQT_TQRECT_OBJECT(rect()).contains(event->pos()) ) { // Accept only if released in systemTray
toggleActive(); toggleActive();
emit showPart(); emit showPart();
event->accept(); event->accept();
@ -350,7 +350,7 @@ void SystemTray::dropEvent(TQDropEvent *event)
/* /*
* This function copies the entirety of src into dest, starting in * This function copies the entirety of src into dest, starting in
* dest at x and y. This function exists because I was unable to tqfind * dest at x and y. This function exists because I was unable to find
* a function like it in either TQImage or kdefx * a function like it in either TQImage or kdefx
*/ */
static bool copyImage(TQImage &dest, TQImage &src, int x, int y) static bool copyImage(TQImage &dest, TQImage &src, int x, int y)

@ -791,7 +791,7 @@ void TagsEditDialog::moveUp()
// Move in the value list: // Move in the value list:
if (tagItem->tagCopy()) { if (tagItem->tagCopy()) {
int pos = m_tagCopies.tqfindIndex(tagItem->tagCopy()); int pos = m_tagCopies.findIndex(tagItem->tagCopy());
m_tagCopies.remove(tagItem->tagCopy()); m_tagCopies.remove(tagItem->tagCopy());
int i = 0; int i = 0;
for (TagCopy::List::iterator it = m_tagCopies.begin(); it != m_tagCopies.end(); ++it, ++i) for (TagCopy::List::iterator it = m_tagCopies.begin(); it != m_tagCopies.end(); ++it, ++i)
@ -801,7 +801,7 @@ void TagsEditDialog::moveUp()
} }
} else { } else {
StateCopy::List &stateCopies = ((TagListViewItem*)( tagItem->tqparent() ))->tagCopy()->stateCopies; StateCopy::List &stateCopies = ((TagListViewItem*)( tagItem->tqparent() ))->tagCopy()->stateCopies;
int pos = stateCopies.tqfindIndex(tagItem->stateCopy()); int pos = stateCopies.findIndex(tagItem->stateCopy());
stateCopies.remove(tagItem->stateCopy()); stateCopies.remove(tagItem->stateCopy());
int i = 0; int i = 0;
for (StateCopy::List::iterator it = stateCopies.begin(); it != stateCopies.end(); ++it, ++i) for (StateCopy::List::iterator it = stateCopies.begin(); it != stateCopies.end(); ++it, ++i)
@ -829,7 +829,7 @@ void TagsEditDialog::moveDown()
// Move in the value list: // Move in the value list:
if (tagItem->tagCopy()) { if (tagItem->tagCopy()) {
uint pos = m_tagCopies.tqfindIndex(tagItem->tagCopy()); uint pos = m_tagCopies.findIndex(tagItem->tagCopy());
m_tagCopies.remove(tagItem->tagCopy()); m_tagCopies.remove(tagItem->tagCopy());
if (pos == m_tagCopies.count() - 1) // Insert at end: iterator does not go there if (pos == m_tagCopies.count() - 1) // Insert at end: iterator does not go there
m_tagCopies.append(tagItem->tagCopy()); m_tagCopies.append(tagItem->tagCopy());
@ -843,7 +843,7 @@ void TagsEditDialog::moveDown()
} }
} else { } else {
StateCopy::List &stateCopies = ((TagListViewItem*)( tagItem->tqparent() ))->tagCopy()->stateCopies; StateCopy::List &stateCopies = ((TagListViewItem*)( tagItem->tqparent() ))->tagCopy()->stateCopies;
uint pos = stateCopies.tqfindIndex(tagItem->stateCopy()); uint pos = stateCopies.findIndex(tagItem->stateCopy());
stateCopies.remove(tagItem->stateCopy()); stateCopies.remove(tagItem->stateCopy());
if (pos == stateCopies.count() - 1) // Insert at end: iterator does not go there if (pos == stateCopies.count() - 1) // Insert at end: iterator does not go there
stateCopies.append(tagItem->stateCopy()); stateCopies.append(tagItem->stateCopy());

@ -69,9 +69,9 @@ TQString Tools::textToHTML(const TQString &text)
if (/*text.isEmpty() ||*/ text == " " || text == "&nbsp;") if (/*text.isEmpty() ||*/ text == " " || text == "&nbsp;")
return "<p>&nbsp;</p>"; return "<p>&nbsp;</p>";
// convertFromPlainText() tqreplace "\n\n" by "</p>\n<p>": we don't want that // convertFromPlainText() replace "\n\n" by "</p>\n<p>": we don't want that
TQString htmlString = TQStyleSheet::convertFromPlainText(text, TQStyleSheetItem::WhiteSpaceNormal); TQString htmlString = TQStyleSheet::convertFromPlainText(text, TQStyleSheetItem::WhiteSpaceNormal);
return htmlString.tqreplace("</p>\n", "<br>\n<br>\n").tqreplace("\n<p>", "\n"); // Don't replace first and last tags return htmlString.replace("</p>\n", "<br>\n<br>\n").replace("\n<p>", "\n"); // Don't replace first and last tags
} }
TQString Tools::textToHTMLWithoutP(const TQString &text) TQString Tools::textToHTMLWithoutP(const TQString &text)
@ -88,7 +88,7 @@ TQString Tools::htmlToParagraph(const TQString &html)
// Remove the <html> start tag, all the <head> and the <body> start // Remove the <html> start tag, all the <head> and the <body> start
// Because <body> can contain style="..." parameter, we transform it to <span> // Because <body> can contain style="..." parameter, we transform it to <span>
int pos = result.tqfind("<body"); int pos = result.find("<body");
if (pos != -1) { if (pos != -1) {
result = "<span" + result.mid(pos + 5); result = "<span" + result.mid(pos + 5);
startedBySpan = true; startedBySpan = true;
@ -96,14 +96,14 @@ TQString Tools::htmlToParagraph(const TQString &html)
// Remove the ending "</p>\n</body></html>", each tag can be separated by space characters (%s) // Remove the ending "</p>\n</body></html>", each tag can be separated by space characters (%s)
// "</p>" can be omitted (eg. if the HTML doesn't contain paragraph but tables), as well as "</body>" (optinal) // "</p>" can be omitted (eg. if the HTML doesn't contain paragraph but tables), as well as "</body>" (optinal)
pos = result.tqfind(TQRegExp("(?:(?:</p>[\\s\\n\\r\\t]*)*</body>[\\s\\n\\r\\t]*)*</html>", false)); // Case unsensitive pos = result.find(TQRegExp("(?:(?:</p>[\\s\\n\\r\\t]*)*</body>[\\s\\n\\r\\t]*)*</html>", false)); // Case unsensitive
if (pos != -1) if (pos != -1)
result = result.left(pos); result = result.left(pos);
if (startedBySpan) if (startedBySpan)
result += "</span>"; result += "</span>";
return result.tqreplace("</p>", "<br><br>").tqreplace("<p>", ""); return result.replace("</p>", "<br><br>").replace("<p>", "");
} }
// The following is adapted from KStringHanlder::tagURLs // The following is adapted from KStringHanlder::tagURLs
@ -125,7 +125,7 @@ TQString Tools::tagURLs(const TQString &text)
continue; continue;
} }
TQString anchor = "<a href=\"" + href + "\">" + href + "</a>"; TQString anchor = "<a href=\"" + href + "\">" + href + "</a>";
richText.tqreplace(urlPos, urlLen, anchor); richText.replace(urlPos, urlLen, anchor);
urlPos += anchor.length(); urlPos += anchor.length();
} }
return richText; return richText;
@ -135,24 +135,24 @@ TQString Tools::htmlToText(const TQString &html)
{ {
TQString text = htmlToParagraph(html); TQString text = htmlToParagraph(html);
text.remove("\n"); text.remove("\n");
text.tqreplace("</h1>", "\n"); text.replace("</h1>", "\n");
text.tqreplace("</h2>", "\n"); text.replace("</h2>", "\n");
text.tqreplace("</h3>", "\n"); text.replace("</h3>", "\n");
text.tqreplace("</h4>", "\n"); text.replace("</h4>", "\n");
text.tqreplace("</h5>", "\n"); text.replace("</h5>", "\n");
text.tqreplace("</h6>", "\n"); text.replace("</h6>", "\n");
text.tqreplace("</li>", "\n"); text.replace("</li>", "\n");
text.tqreplace("</dt>", "\n"); text.replace("</dt>", "\n");
text.tqreplace("</dd>", "\n"); text.replace("</dd>", "\n");
text.tqreplace("<dd>", " "); text.replace("<dd>", " ");
text.tqreplace("</div>","\n"); text.replace("</div>","\n");
text.tqreplace("</blockquote>","\n"); text.replace("</blockquote>","\n");
text.tqreplace("</caption>","\n"); text.replace("</caption>","\n");
text.tqreplace("</tr>", "\n"); text.replace("</tr>", "\n");
text.tqreplace("</th>", " "); text.replace("</th>", " ");
text.tqreplace("</td>", " "); text.replace("</td>", " ");
text.tqreplace("<br>", "\n"); text.replace("<br>", "\n");
text.tqreplace("<br />","\n"); text.replace("<br />","\n");
// FIXME: Format <table> tags better, if possible // FIXME: Format <table> tags better, if possible
// TODO: Replace &eacute; and co. by theire equivalent! // TODO: Replace &eacute; and co. by theire equivalent!
@ -165,7 +165,7 @@ TQString Tools::htmlToText(const TQString &html)
TQValueStack<bool> ul; // true if current list is a <ul> one, false if it's an <ol> one TQValueStack<bool> ul; // true if current list is a <ul> one, false if it's an <ol> one
TQValueStack<int> lines; // The line number if it is an <ol> list TQValueStack<int> lines; // The line number if it is an <ol> list
// We're removing every other tags, or replace them in the case of li: // We're removing every other tags, or replace them in the case of li:
while ( (pos = text.tqfind("<"), pos) != -1 ) { while ( (pos = text.find("<"), pos) != -1 ) {
// What is the current tag? // What is the current tag?
tag = text.mid(pos + 1, 2); tag = text.mid(pos + 1, 2);
tag3 = text.mid(pos + 1, 3); tag3 = text.mid(pos + 1, 3);
@ -184,7 +184,7 @@ TQString Tools::htmlToText(const TQString &html)
lines.pop(); lines.pop();
} }
// Where the tag closes? // Where the tag closes?
pos2 = text.tqfind(">"); pos2 = text.find(">");
if (pos2 != -1) { if (pos2 != -1) {
// Remove the tag: // Remove the tag:
text.remove(pos, pos2 - pos + 1); text.remove(pos, pos2 - pos + 1);
@ -209,11 +209,11 @@ TQString Tools::htmlToText(const TQString &html)
++pos; ++pos;
} }
text.tqreplace("&gt;", ">"); text.replace("&gt;", ">");
text.tqreplace("&lt;", "<"); text.replace("&lt;", "<");
text.tqreplace("&quot;", "\""); text.replace("&quot;", "\"");
text.tqreplace("&nbsp;", " "); text.replace("&nbsp;", " ");
text.tqreplace("&amp;", "&"); // CONVERT IN LAST!! text.replace("&amp;", "&"); // CONVERT IN LAST!!
return text; return text;
} }
@ -227,14 +227,14 @@ TQString Tools::cssFontDefinition(const TQFont &font, bool onlyFontFamily)
// Then, try to match the font name with a standard CSS font family: // Then, try to match the font name with a standard CSS font family:
TQString genericFont = ""; TQString genericFont = "";
if (definition.tqcontains("serif", false) || definition.tqcontains("roman", false)) if (definition.contains("serif", false) || definition.contains("roman", false))
genericFont = "serif"; genericFont = "serif";
// No "else if" because "sans serif" must be counted as "sans". So, the order between "serif" and "sans" is important // No "else if" because "sans serif" must be counted as "sans". So, the order between "serif" and "sans" is important
if (definition.tqcontains("sans", false) || definition.tqcontains("arial", false) || definition.tqcontains("helvetica", false)) if (definition.contains("sans", false) || definition.contains("arial", false) || definition.contains("helvetica", false))
genericFont = "sans-serif"; genericFont = "sans-serif";
if (definition.tqcontains("mono", false) || definition.tqcontains("courier", false) || if (definition.contains("mono", false) || definition.contains("courier", false) ||
definition.tqcontains("typewriter", false) || definition.tqcontains("console", false) || definition.contains("typewriter", false) || definition.contains("console", false) ||
definition.tqcontains("terminal", false) || definition.tqcontains("news", false)) definition.contains("terminal", false) || definition.contains("news", false))
genericFont = "monospace"; genericFont = "monospace";
// Eventually add the generic font family to the definition: // Eventually add the generic font family to the definition:
@ -384,7 +384,7 @@ TQString Tools::fileNameForNewFile(const TQString &wantedName, const TQString &d
// Find the file extension, if it exists : Split fileName in fileName and extension // Find the file extension, if it exists : Split fileName in fileName and extension
// Example : fileName == "note5-3.txt" => fileName = "note5-3" and extension = ".txt" // Example : fileName == "note5-3.txt" => fileName = "note5-3" and extension = ".txt"
int extIndex = fileName.tqfindRev('.'); int extIndex = fileName.findRev('.');
if (extIndex != -1 && extIndex != int(fileName.length()-1)) { // Extension found and fileName do not ends with '.' ! if (extIndex != -1 && extIndex != int(fileName.length()-1)) { // Extension found and fileName do not ends with '.' !
extension = fileName.mid(extIndex); extension = fileName.mid(extIndex);
fileName.truncate(extIndex); fileName.truncate(extIndex);
@ -392,7 +392,7 @@ TQString Tools::fileNameForNewFile(const TQString &wantedName, const TQString &d
// Find the file number, if it exists : Split fileName in fileName and number // Find the file number, if it exists : Split fileName in fileName and number
// Example : fileName == "note5-3" => fileName = "note5" and number = 3 // Example : fileName == "note5-3" => fileName = "note5" and number = 3
int extNumber = fileName.tqfindRev('-'); int extNumber = fileName.findRev('-');
if (extNumber != -1 && extNumber != int(fileName.length()-1)) { // Number found and fileName do not ends with '-' ! if (extNumber != -1 && extNumber != int(fileName.length()-1)) { // Number found and fileName do not ends with '-' !
bool isANumber; bool isANumber;
int theNumber = fileName.mid(extNumber + 1).toInt(&isANumber); int theNumber = fileName.mid(extNumber + 1).toInt(&isANumber);

Loading…
Cancel
Save