summaryrefslogtreecommitdiffstats
path: root/kexi/widget/utils
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
commitb6edfe41c9395f2e20784cbf0e630af6426950a3 (patch)
tree56ed9b871d4296e6c15949c24e16420be1b28697 /kexi/widget/utils
parentef39e8e4178a8f98cf5f154916ba0f03e4855206 (diff)
downloadkoffice-b6edfe41c9395f2e20784cbf0e630af6426950a3.tar.gz
koffice-b6edfe41c9395f2e20784cbf0e630af6426950a3.zip
rename the following methods:
tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/widget/utils')
-rw-r--r--kexi/widget/utils/kexicontextmenuutils.cpp2
-rw-r--r--kexi/widget/utils/kexidatetimeformatter.cpp80
-rw-r--r--kexi/widget/utils/kexigradientwidget.cpp12
3 files changed, 47 insertions, 47 deletions
diff --git a/kexi/widget/utils/kexicontextmenuutils.cpp b/kexi/widget/utils/kexicontextmenuutils.cpp
index 8c6c3ab2..f882f6fa 100644
--- a/kexi/widget/utils/kexicontextmenuutils.cpp
+++ b/kexi/widget/utils/kexicontextmenuutils.cpp
@@ -258,7 +258,7 @@ bool KexiContextMenuUtils::updateTitle(TQPopupMenu *menu, const TQString& object
if (!menu || objectName.isEmpty() || objectTypeName.isEmpty())
return false;
const int id = menu->idAt(0);
- TQMenuItem *item = menu->tqfindItem(id);
+ TQMenuItem *item = menu->findItem(id);
if (!item)
return false;
KPopupTitle *title = dynamic_cast<KPopupTitle *>(item->widget());
diff --git a/kexi/widget/utils/kexidatetimeformatter.cpp b/kexi/widget/utils/kexidatetimeformatter.cpp
index 430d2f8f..1e7b9bc9 100644
--- a/kexi/widget/utils/kexidatetimeformatter.cpp
+++ b/kexi/widget/utils/kexidatetimeformatter.cpp
@@ -43,27 +43,27 @@ KexiDateFormatter::KexiDateFormatter()
monthDateFormat("MM"),
dayDateFormat("dd"); //for setting up m_dateFormat
bool ok = df.length()>=8;
- int yearpos, monthpos, daypos; //result of df.tqfind()
+ int yearpos, monthpos, daypos; //result of df.find()
if (ok) {//look at % variables
//! @todo more variables are possible here, see void KLocale::setDateFormatShort() docs
//! http://developer.kde.org/documentation/library/3.5-api/kdelibs-apidocs/kdecore/html/classKLocale.html#a59
- yearpos = df.tqfind("%y", 0, false); //&y or %y
+ yearpos = df.find("%y", 0, false); //&y or %y
m_longYear = !(yearpos>=0 && df.mid(yearpos+1, 1)=="y");
if (!m_longYear) {
yearMask = "99";
yearDateFormat = "yy";
}
- monthpos = df.tqfind("%m", 0, true); //%m or %n
+ monthpos = df.find("%m", 0, true); //%m or %n
m_monthWithLeadingZero = true;
if (monthpos<0) {
- monthpos = df.tqfind("%n", 0, false);
+ monthpos = df.find("%n", 0, false);
m_monthWithLeadingZero = false;
monthDateFormat = "M";
}
- daypos = df.tqfind("%d", 0, true);//%d or %e
+ daypos = df.find("%d", 0, true);//%d or %e
m_dayWithLeadingZero = true;
if (daypos<0) {
- daypos = df.tqfind("%e", 0, false);
+ daypos = df.find("%e", 0, false);
m_dayWithLeadingZero = false;
dayDateFormat = "d";
}
@@ -76,7 +76,7 @@ KexiDateFormatter::KexiDateFormatter()
}
else if (yearpos<daypos && daypos<monthpos) {
m_order = TQDateEdit::YDM;
-//! @todo use TQRegExp (to tqreplace %Y by %1, etc.) instead of hardcoded "%1%299%399"
+//! @todo use TQRegExp (to replace %Y by %1, etc.) instead of hardcoded "%1%299%399"
//! because df may contain also other characters
m_inputMask = TQString("%1%299%399").tqarg(yearMask).tqarg(m_separator).tqarg(m_separator);
m_qtFormat = yearDateFormat+m_separator+dayDateFormat+m_separator+monthDateFormat;
@@ -157,7 +157,7 @@ TQVariant KexiDateFormatter::stringToVariant( const TQString& str ) const
bool KexiDateFormatter::isEmpty( const TQString& str ) const
{
TQString s(str);
- return s.tqreplace(m_separator,"").stripWhiteSpace().isEmpty();
+ return s.replace(m_separator,"").stripWhiteSpace().isEmpty();
}
TQString KexiDateFormatter::dateToString( const TQDate& date ) const
@@ -172,31 +172,31 @@ KexiTimeFormatter::KexiTimeFormatter()
, m_hmRegExp( new TQRegExp("(\\d*):(\\d*).*( am| pm){,1}", false/*!CS*/) )
{
TQString tf( KGlobal::locale()->timeFormat() );
- //m_hourpos, m_minpos, m_secpos; are result of tf.tqfind()
+ //m_hourpos, m_minpos, m_secpos; are result of tf.find()
TQString hourVariable, minVariable, secVariable;
- //detect position of HOUR section: tqfind %H or %k or %I or %l
+ //detect position of HOUR section: find %H or %k or %I or %l
m_24h = true;
m_hoursWithLeadingZero = true;
- m_hourpos = tf.tqfind("%H", 0, true);
+ m_hourpos = tf.find("%H", 0, true);
if (m_hourpos>=0) {
m_24h = true;
m_hoursWithLeadingZero = true;
}
else {
- m_hourpos = tf.tqfind("%k", 0, true);
+ m_hourpos = tf.find("%k", 0, true);
if (m_hourpos>=0) {
m_24h = true;
m_hoursWithLeadingZero = false;
}
else {
- m_hourpos = tf.tqfind("%I", 0, true);
+ m_hourpos = tf.find("%I", 0, true);
if (m_hourpos>=0) {
m_24h = false;
m_hoursWithLeadingZero = true;
}
else {
- m_hourpos = tf.tqfind("%l", 0, true);
+ m_hourpos = tf.find("%l", 0, true);
if (m_hourpos>=0) {
m_24h = false;
m_hoursWithLeadingZero = false;
@@ -204,9 +204,9 @@ KexiTimeFormatter::KexiTimeFormatter()
}
}
}
- m_minpos = tf.tqfind("%M", 0, true);
- m_secpos = tf.tqfind("%S", 0, true); //can be -1
- m_ampmpos = tf.tqfind("%p", 0, true); //can be -1
+ m_minpos = tf.find("%M", 0, true);
+ m_secpos = tf.find("%S", 0, true); //can be -1
+ m_ampmpos = tf.find("%p", 0, true); //can be -1
if (m_hourpos<0 || m_minpos<0) {
//set default: hr and min are needed, sec are optional
@@ -221,13 +221,13 @@ KexiTimeFormatter::KexiTimeFormatter()
hourVariable = tf.mid(m_hourpos, 2);
m_inputMask = tf;
-// m_inputMask.tqreplace( hourVariable, "00" );
-// m_inputMask.tqreplace( "%M", "00" );
-// m_inputMask.tqreplace( "%S", "00" ); //optional
- m_inputMask.tqreplace( hourVariable, "99" );
- m_inputMask.tqreplace( "%M", "99" );
- m_inputMask.tqreplace( "%S", "00" ); //optional
- m_inputMask.tqreplace( "%p", "AA" ); //am or pm
+// m_inputMask.replace( hourVariable, "00" );
+// m_inputMask.replace( "%M", "00" );
+// m_inputMask.replace( "%S", "00" ); //optional
+ m_inputMask.replace( hourVariable, "99" );
+ m_inputMask.replace( "%M", "99" );
+ m_inputMask.replace( "%S", "00" ); //optional
+ m_inputMask.replace( "%p", "AA" ); //am or pm
m_inputMask += ";_";
m_outputFormat = tf;
@@ -283,7 +283,7 @@ TQVariant KexiTimeFormatter::stringToVariant( const TQString& str )
bool KexiTimeFormatter::isEmpty( const TQString& str ) const
{
TQString s(str);
- return s.tqreplace(':',"").stripWhiteSpace().isEmpty();
+ return s.replace(':',"").stripWhiteSpace().isEmpty();
}
TQString KexiTimeFormatter::timeToString( const TQTime& time ) const
@@ -294,22 +294,22 @@ TQString KexiTimeFormatter::timeToString( const TQTime& time ) const
TQString s(m_outputFormat);
if (m_24h) {
if (m_hoursWithLeadingZero)
- s.tqreplace( "%H", TQString::tqfromLatin1(time.hour()<10 ? "0" : "") + TQString::number(time.hour()) );
+ s.replace( "%H", TQString::tqfromLatin1(time.hour()<10 ? "0" : "") + TQString::number(time.hour()) );
else
- s.tqreplace( "%k", TQString::number(time.hour()) );
+ s.replace( "%k", TQString::number(time.hour()) );
}
else {
int time12 = (time.hour()>12) ? (time.hour()-12) : time.hour();
if (m_hoursWithLeadingZero)
- s.tqreplace( "%I", TQString::tqfromLatin1(time12<10 ? "0" : "") + TQString::number(time12) );
+ s.replace( "%I", TQString::tqfromLatin1(time12<10 ? "0" : "") + TQString::number(time12) );
else
- s.tqreplace( "%l", TQString::number(time12) );
+ s.replace( "%l", TQString::number(time12) );
}
- s.tqreplace( "%M", TQString::tqfromLatin1(time.minute()<10 ? "0" : "") + TQString::number(time.minute()) );
+ s.replace( "%M", TQString::tqfromLatin1(time.minute()<10 ? "0" : "") + TQString::number(time.minute()) );
if (m_secpos>=0)
- s.tqreplace( "%S", TQString::tqfromLatin1(time.second()<10 ? "0" : "") + TQString::number(time.second()) );
+ s.replace( "%S", TQString::tqfromLatin1(time.second()<10 ? "0" : "") + TQString::number(time.second()) );
if (m_ampmpos>=0)
- s.tqreplace( "%p", KGlobal::locale()->translate( time.hour()>=12 ? "pm" : "am") );
+ s.replace( "%p", KGlobal::locale()->translate( time.hour()>=12 ? "pm" : "am") );
return s;
}
@@ -326,8 +326,8 @@ TQDateTime stringToDateTime(
const KexiDateFormatter& dateFormatter, const KexiTimeFormatter& timeFormatter, const TQString& str)
{
TQString s( str.stripWhiteSpace() );
- const int timepos = s.tqfind(" ");
- const bool emptyTime = timepos >= 0 && timeFormatter.isEmpty(s.mid(timepos+1)); //.tqreplace(':',"").stripWhiteSpace().isEmpty();
+ const int timepos = s.find(" ");
+ const bool emptyTime = timepos >= 0 && timeFormatter.isEmpty(s.mid(timepos+1)); //.replace(':',"").stripWhiteSpace().isEmpty();
if (emptyTime)
s = s.left(timepos);
if (timepos>0 && !emptyTime) {
@@ -347,18 +347,18 @@ TQDateTime stringToDateTime(
bool dateTimeIsEmpty( const KexiDateFormatter& dateFormatter, const KexiTimeFormatter& timeFormatter,
const TQString& str )
{
- int timepos = str.tqfind(" ");
- const bool emptyTime = timepos >= 0 && timeFormatter.isEmpty(str.mid(timepos+1)); //s.mid(timepos+1).tqreplace(':',"").stripWhiteSpace().isEmpty();
- return (timepos >= 0 && dateFormatter.isEmpty(str.left(timepos)) //s.left(timepos).tqreplace(m_dateFormatter.separator(), "").stripWhiteSpace().isEmpty()
+ int timepos = str.find(" ");
+ const bool emptyTime = timepos >= 0 && timeFormatter.isEmpty(str.mid(timepos+1)); //s.mid(timepos+1).replace(':',"").stripWhiteSpace().isEmpty();
+ return (timepos >= 0 && dateFormatter.isEmpty(str.left(timepos)) //s.left(timepos).replace(m_dateFormatter.separator(), "").stripWhiteSpace().isEmpty()
&& emptyTime);
}
bool dateTimeIsValid( const KexiDateFormatter& dateFormatter,
const KexiTimeFormatter& timeFormatter, const TQString& str )
{
- int timepos = str.tqfind(" ");
- const bool emptyTime = timepos >= 0 && timeFormatter.isEmpty(str.mid(timepos+1)); //s.mid(timepos+1).tqreplace(':',"").stripWhiteSpace().isEmpty();
- if (timepos >= 0 && dateFormatter.isEmpty(str.left(timepos)) // s.left(timepos).tqreplace(m_dateFormatter.separator(), "").stripWhiteSpace().isEmpty()
+ int timepos = str.find(" ");
+ const bool emptyTime = timepos >= 0 && timeFormatter.isEmpty(str.mid(timepos+1)); //s.mid(timepos+1).replace(':',"").stripWhiteSpace().isEmpty();
+ if (timepos >= 0 && dateFormatter.isEmpty(str.left(timepos)) // s.left(timepos).replace(m_dateFormatter.separator(), "").stripWhiteSpace().isEmpty()
&& emptyTime)
//empty date/time is valid
return true;
diff --git a/kexi/widget/utils/kexigradientwidget.cpp b/kexi/widget/utils/kexigradientwidget.cpp
index 2a1a3ba3..ce92444f 100644
--- a/kexi/widget/utils/kexigradientwidget.cpp
+++ b/kexi/widget/utils/kexigradientwidget.cpp
@@ -98,7 +98,7 @@ void KexiGradientWidget::rebuildCache( void ) {
for ( WidgetList::Iterator it = childWidgetList.begin();
it != childWidgetList.end(); ++it ) {
- if ( p_customBackgroundWidgets.tqcontains( ( *it ) ) == false ) {
+ if ( p_customBackgroundWidgets.contains( ( *it ) ) == false ) {
( *it )->unsetPalette();
}
}
@@ -170,7 +170,7 @@ void KexiGradientWidget::rebuildCache( void ) {
/**
Exclude widgets with a custom palette.
*/
- if ( p_customBackgroundWidgets.tqcontains( childWidget ) ) {
+ if ( p_customBackgroundWidgets.contains( childWidget ) ) {
continue;
}
@@ -255,7 +255,7 @@ bool KexiGradientWidget::eventFilter( TQObject* object, TQEvent* event ) {
In this case, it has to be added to the customBackground-list.
*/
if ( p_currentChild == 0L && child != 0L ) {
- if ( p_customBackgroundWidgets.tqcontains( child ) == false ) {
+ if ( p_customBackgroundWidgets.contains( child ) == false ) {
p_customBackgroundWidgets.append( child );
return false;
}
@@ -269,7 +269,7 @@ bool KexiGradientWidget::eventFilter( TQObject* object, TQEvent* event ) {
Add the new child to the list of widgets, we don't set
the background ourselves if it isn't in the list.
*/
- if ( p_customBackgroundWidgets.tqcontains( child ) == false ) {
+ if ( p_customBackgroundWidgets.contains( child ) == false ) {
if ( child->paletteBackgroundPixmap() != 0L ) {
p_customBackgroundWidgets.append( child );
}
@@ -291,7 +291,7 @@ bool KexiGradientWidget::eventFilter( TQObject* object, TQEvent* event ) {
}
if ( event->type() == TQEvent::Move ) {
- if ( p_customBackgroundWidgets.tqcontains( child ) == false ) {
+ if ( p_customBackgroundWidgets.contains( child ) == false ) {
updateChildBackground( child );
}
}
@@ -320,7 +320,7 @@ void KexiGradientWidget::updateChildBackground( TQWidget* childWidget )
/**
Exclude widgets with a custom palette.
*/
- if ( p_customBackgroundWidgets.tqcontains( childWidget ) ) {
+ if ( p_customBackgroundWidgets.contains( childWidget ) ) {
return;
}