Here's a pair of patches to clean up some more KDE deprecated
warnings, including, in no particular order:
QCString QObject::name -> QString QObject::objectName
QComboBox::insertItem() -> QComboBox::addItem() (for appending)
QDir::setNameFilter(const QString &) -> QDir::setNameFilters(const
QStringList &)
QString::find -> QString::indexOf
Also, in libkopete/kopetecontactlist.cpp, saveTimer was
setSingleShot() on construction, so we don't need to call
setSingleShot() again.
-Scott Wolchok
Index: libkopete/avdevice/videodevicepool.cpp
===================================================================
--- libkopete/avdevice/videodevicepool.cpp (revision 532781)
+++ libkopete/avdevice/videodevicepool.cpp (working copy)
@@ -517,10 +517,10 @@
{
for (unsigned int loop=0; loop < m_videodevice.size(); loop++)
{
- combobox->insertItem(m_videodevice[loop].m_name);
+ combobox->addItem(m_videodevice[loop].m_name);
kDebug() << k_funcinfo << "DeviceKCombobox: Added device " << loop << ": " << m_videodevice[loop].m_name << endl;
}
- combobox->setCurrentItem(currentDevice());
+ combobox->setCurrentIndex(currentDevice());
return EXIT_SUCCESS;
}
return EXIT_FAILURE;
@@ -540,10 +540,10 @@
{
for (unsigned int loop=0; loop < m_videodevice[currentDevice()].inputs(); loop++)
{
- combobox->insertItem(m_videodevice[currentDevice()].m_input[loop].name);
+ combobox->addItem(m_videodevice[currentDevice()].m_input[loop].name);
kDebug() << k_funcinfo << "InputKCombobox: Added input " << loop << ": " << m_videodevice[currentDevice()].m_input[loop].name << " (tuner: " << m_videodevice[currentDevice()].m_input[loop].hastuner << ")" << endl;
}
- combobox->setCurrentItem(currentInput());
+ combobox->setCurrentIndex(currentInput());
return EXIT_SUCCESS;
}
}
@@ -565,7 +565,7 @@
for (unsigned int loop=0; loop < 25; loop++)
{
if ( (m_videodevice[currentDevice()].m_input[currentInput()].m_standards) & (1 << loop) )
- combobox->insertItem(m_videodevice[currentDevice()].signalStandardName( 1 << loop));
+ combobox->addItem(m_videodevice[currentDevice()].signalStandardName( 1 << loop));
/*
case STANDARD_PAL_B1 : return V4L2_STD_PAL_B1; break;
case STANDARD_PAL_G : return V4L2_STD_PAL_G; break;
@@ -604,7 +604,7 @@
combobox->insertItem(m_videodevice[currentDevice()].m_input[loop].name);
kdDebug() << k_funcinfo << "StandardKCombobox: Added input " << loop << ": " << m_videodevice[currentDevice()].m_input[loop].name << " (tuner: " << m_videodevice[currentDevice()].m_input[loop].hastuner << ")" << endl;*/
}
- combobox->setCurrentItem(currentInput());
+ combobox->setCurrentIndex(currentInput());
return EXIT_SUCCESS;
}
}
@@ -622,14 +622,14 @@
#if defined(__linux__) && defined(ENABLE_AV)
QDir videodevice_dir;
const QString videodevice_dir_path=QString::fromLocal8Bit("/dev/v4l/");
- const QString videodevice_dir_filter=QString::fromLocal8Bit("video*");
+ const QStringList videodevice_dir_filter=QStringList(QString::fromLocal8Bit("video*"));
VideoDevice videodevice;
m_videodevice.clear();
m_modelvector.clear();
videodevice_dir.setPath(videodevice_dir_path);
- videodevice_dir.setNameFilter(videodevice_dir_filter);
+ videodevice_dir.setNameFilters(videodevice_dir_filter);
videodevice_dir.setFilter( QDir::System | QDir::NoSymLinks | QDir::Readable | QDir::Writable );
videodevice_dir.setSorting( QDir::Name );
@@ -640,11 +640,11 @@
kDebug() << k_funcinfo << "Found no suitable devices in " << videodevice_dir_path << endl;
QDir videodevice_dir;
const QString videodevice_dir_path=QString::fromLocal8Bit("/dev/");
- const QString videodevice_dir_filter=QString::fromLocal8Bit("video*");
+ const QStringList videodevice_dir_filter=QStringList(QString::fromLocal8Bit("video*"));
VideoDevice videodevice;
videodevice_dir.setPath(videodevice_dir_path);
- videodevice_dir.setNameFilter(videodevice_dir_filter);
+ videodevice_dir.setNameFilters(videodevice_dir_filter);
videodevice_dir.setFilter( QDir::System | QDir::NoSymLinks | QDir::Readable | QDir::Writable );
videodevice_dir.setSorting( QDir::Name );
Index: libkopete/kopetecontactlist.cpp
===================================================================
--- libkopete/kopetecontactlist.cpp (revision 532781)
+++ libkopete/kopetecontactlist.cpp (working copy)
@@ -899,8 +899,8 @@
}
// if we got here, saving the contact list failed. retry every minute until it works.
- // single-shot: will get restarted by us next time if it's still failing
- d->saveTimer->setSingleShot( true );
+ //Constructed single-shot: will get restarted by us next time if it's still
+ //failing
d->saveTimer->start( 60000 );
}
Index: libkopete/kopetemetacontact.cpp
===================================================================
--- libkopete/kopetemetacontact.cpp (revision 532781)
+++ libkopete/kopetemetacontact.cpp (working copy)
@@ -1420,7 +1420,7 @@
if(newValue.canConvert( QVariant::Image ))
img=newValue.value<QImage>();
else if(newValue.canConvert( QVariant::Pixmap ))
- img=newValue.value<QPixmap>();
+ img=newValue.value<QPixmap>().toImage();
if(img.isNull())
{
Index: libkopete/kopetecommandhandler.cpp
===================================================================
--- libkopete/kopetecommandhandler.cpp (revision 532781)
+++ libkopete/kopetecommandhandler.cpp (working copy)
@@ -64,13 +64,13 @@
actionCollection()->insert( a );
QDomElement newNode = doc.createElement( QString::fromLatin1("Action") );
newNode.setAttribute( QString::fromLatin1("name"),
- QString::fromLatin1( a->name() ) );
+ a->objectName() );
bool added = false;
for( QDomElement n = menu.firstChild().toElement();
!n.isNull(); n = n.nextSibling().toElement() )
{
- if( QString::fromLatin1(a->name()) < n.attribute(QString::fromLatin1("name")))
+ if( a->objectName() < n.attribute(QString::fromLatin1("name")))
{
menu.insertBefore( newNode, n );
added = true;
Index: libkopete/kabcpersistence.cpp
===================================================================
--- libkopete/kabcpersistence.cpp (revision 532781)
+++ libkopete/kabcpersistence.cpp (working copy)
@@ -313,7 +313,7 @@
// Is it in the contact list?
// First discard anything after an 0xE120, this is used by IRC to separate nick and server group name, but
// IRC doesn't support this properly yet, so the user will have to select an appropriate account manually
- int separatorPos = (*it).find( QChar( 0xE120 ) );
+ int separatorPos = (*it).indexOf( QChar( 0xE120 ) );
if ( separatorPos != -1 )
*it = (*it).left( separatorPos );
Index: libkopete/kopeteblacklister.cpp
===================================================================
--- libkopete/kopeteblacklister.cpp (revision 532781)
+++ libkopete/kopeteblacklister.cpp (working copy)
@@ -55,7 +55,7 @@
bool BlackLister::isBlocked(const QString &contactId)
{
- return (d->blacklist.find( contactId ) != d->blacklist.end() );
+ return d->blacklist.contains( contactId );
}
bool BlackLister::isBlocked(Contact *contact)
Index: libkopete/kopetecommand.cpp
===================================================================
--- libkopete/kopetecommand.cpp (revision 532781)
+++ libkopete/kopetecommand.cpp (working copy)
@@ -113,7 +113,7 @@
"\"%1\" has a maximum of %n arguments.", m_minArgs,
text() ), manager, gui );
}
- else if( !KAuthorized::authorizeKAction( name() ) )
+ else if( !KAuthorized::authorizeKAction( objectName() ) )
{
printError( i18n("You are not authorized to perform the command \"%1\".", text()), manager, gui );
}
_______________________________________________
kopete-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kopete-devel