OK I decided to leave libiris alone and I ported a few more things. I still have a long list of things to port and warnings to fix but here is the latest SVN diff.
-- Guillermo Antonio Amaral Bastidas # Free & Open Source Software Advocate # KDE Developer (gamaral) $ irc: [EMAIL PROTECTED] @ blog: http://blog.guillermoamaral.com/ @ site: http://www.guillermoamaral.com/ % gpg: http://downloads.guillermoamaral.com/public.asc
Index: plugins/translator/translatordialog.cpp
===================================================================
--- plugins/translator/translatordialog.cpp (revision 681822)
+++ plugins/translator/translatordialog.cpp (working copy)
@@ -37,7 +37,7 @@
QString TranslatorDialog::translatedText()
{
- return m_textEdit->text();
+ return m_textEdit->toPlainText();
}
/*void TranslatorDialog::slotFinished()
{
Index: plugins/smpppdcs/libsmpppdclient/smpppdready.cpp
===================================================================
--- plugins/smpppdcs/libsmpppdclient/smpppdready.cpp (revision 681822)
+++ plugins/smpppdcs/libsmpppdclient/smpppdready.cpp (working copy)
@@ -89,7 +89,7 @@
QString cmd = "list-status " + ifcfg;
- write(client, cmd.latin1());
+ write(client, cmd.toLatin1());
socket(client)->waitForMore(0);
QStringList stream = read(client);
Index: plugins/smpppdcs/libsmpppdclient/smpppdunsettled.cpp
===================================================================
--- plugins/smpppdcs/libsmpppdclient/smpppdunsettled.cpp (revision 681822)
+++ plugins/smpppdcs/libsmpppdclient/smpppdunsettled.cpp (working copy)
@@ -99,7 +99,7 @@
clg.exactMatch(response)) {
if(!password(client).isNull()) {
// we are challenged, ok, respond
- write(client, QString("response = %1\n").arg(make_response(clg.cap(1)..trimmed(), password(client))).latin1());
+ write(client, QString("response = %1\n").arg(make_response(clg.cap(1)..trimmed(), password(client))).toLatin1());
response = read(client)[0];
if(ver.exactMatch(response)) {
setServerID(client, response);
Index: plugins/smpppdcs/detectordcop.cpp
===================================================================
--- plugins/smpppdcs/detectordcop.cpp (revision 681822)
+++ plugins/smpppdcs/detectordcop.cpp (working copy)
@@ -21,11 +21,11 @@
#include "detectordcop.h"
#include "iconnector.h"
-//Added by qt3to4:
-#include <Q3CString>
-Q3CString DetectorDCOP::m_kinternetApp = "";
+#include <QByteArray>
+QByteArray DetectorDCOP::m_kinternetApp = "";
+
DetectorDCOP::DetectorDCOP(IConnector * connector)
: Detector(connector) {}
@@ -34,7 +34,7 @@
/*!
\fn DetectorDCOP::getKInternetDCOP()
*/
-Q3CString DetectorDCOP::getKInternetDCOP() const {
+QByteArray DetectorDCOP::getKInternetDCOP() const {
DCOPClient * client = kapp->dcopClient();
if(m_kinternetApp.isEmpty() && client && client->isAttached()) {
// get all registered dcop apps and search for kinternet
Index: plugins/smpppdcs/detectordcop.h
===================================================================
--- plugins/smpppdcs/detectordcop.h (revision 681822)
+++ plugins/smpppdcs/detectordcop.h (working copy)
@@ -19,7 +19,7 @@
#include "detector.h"
-#include <Q3CString>
+#include <QByteArray>
class IConnector;
@@ -40,11 +40,11 @@
ERROR
};
- Q3CString getKInternetDCOP() const;
+ QByteArray getKInternetDCOP() const;
KInternetDCOPState getConnectionStatusDCOP() const;
protected:
- static Q3CString m_kinternetApp;
+ static QByteArray m_kinternetApp;
private:
Q_DISABLE_COPY(DetectorDCOP)
Index: protocols/msn/transport.cpp
===================================================================
--- protocols/msn/transport.cpp (revision 681822)
+++ protocols/msn/transport.cpp (working copy)
@@ -244,7 +244,7 @@
mVerified = true;
QString foo = "foo\0";
- mSocket->writeBlock(foo.toAscii(), foo.length());
+ mSocket->write(foo.toAscii(), foo.length());
foo.clear();
emit bridgeConnect();
@@ -255,7 +255,7 @@
kDebug (14140) << k_funcinfo << "Bridge (" << name() << ") RECEIVED " << mSocket->bytesAvailable() << " bytes." << endl;
QByteArray bytes(mSocket->bytesAvailable());
- mSocket->readBlock(bytes.data(), bytes.size());
+ mSocket->read(bytes.data(), bytes.size());
// Write the data to the buffer.
mBuffer.write(bytes);
Index: protocols/sms/services/gsmlib.cpp
===================================================================
--- protocols/sms/services/gsmlib.cpp (revision 681822)
+++ protocols/sms/services/gsmlib.cpp (working copy)
@@ -133,7 +133,7 @@
{
kDebug( 14160 ) << "Connecting to: '"<<m_device<<"'"<<endl;
- gsmlib::Ref<gsmlib::Port> port = new gsmlib::KopeteUnixSerialPort(m_device.latin1(), 9600, gsmlib::DEFAULT_INIT_STRING, false);
+ gsmlib::Ref<gsmlib::Port> port = new gsmlib::KopeteUnixSerialPort(m_device.toLatin1(), 9600, gsmlib::DEFAULT_INIT_STRING, false);
kDebug( 14160 ) << "Port created"<<endl;
@@ -218,7 +218,7 @@
// Do we need to fetch it from the ME?
if( m.Message.isnull() )
{
- gsmlib::SMSStoreRef store = m_MeTa->getSMSStore(m.StoreName.latin1());
+ gsmlib::SMSStoreRef store = m_MeTa->getSMSStore(m.StoreName.toLatin1());
store->setCaching(false);
m.Message = (*store.getptr())[m.Index].message();
@@ -273,9 +273,9 @@
try
{
gsmlib::Ref<gsmlib::SMSSubmitMessage> submitSMS = new gsmlib::SMSSubmitMessage();
- gsmlib::Address destAddr( nr.latin1() );
+ gsmlib::Address destAddr( nr.toLatin1() );
submitSMS->setDestinationAddress(destAddr);
- m_MeTa->sendSMSs(submitSMS, message.latin1(), true);
+ m_MeTa->sendSMSs(submitSMS, message.toLatin1(), true);
GSMLibEvent* e = new GSMLibEvent( GSMLibEvent::MSG_SENT );
e->Message = msg;
Index: protocols/meanwhile/meanwhilesession.cpp
===================================================================
--- protocols/meanwhile/meanwhilesession.cpp (revision 681822)
+++ protocols/meanwhile/meanwhilesession.cpp (working copy)
@@ -425,7 +425,7 @@
}
while (socket && socket->bytesAvailable() > 0) {
- bytesRead = socket->readBlock((char *)buf, MEANWHILE_SESSION_BUFSIZ);
+ bytesRead = socket->read((char *)buf, MEANWHILE_SESSION_BUFSIZ);
if (bytesRead < 0)
break;
mwSession_recv(session, buf, (unsigned int)bytesRead);
@@ -595,7 +595,7 @@
int remaining, retval = 0;
for (remaining = count; remaining > 0; remaining -= retval) {
- retval = socket->writeBlock((char *)buffer, count);
+ retval = socket->write((char *)buffer, count);
if (retval <= 0)
return 1;
}
Index: protocols/irc/libkirc/kernel/kircmessage.cpp
===================================================================
--- protocols/irc/libkirc/kernel/kircmessage.cpp (revision 681822)
+++ protocols/irc/libkirc/kernel/kircmessage.cpp (working copy)
@@ -158,12 +158,12 @@
if (regexp.exactMatch(d->raw))
{
-// d->line = regexp.cap(1).latin1();
- d->prefix = regexp.cap(1).latin1();
- d->command = regexp.cap(2).latin1();
- d->args = regexp.cap(3).latin1();
+// d->line = regexp.cap(1).toLatin1();
+ d->prefix = regexp.cap(1).toLatin1();
+ d->command = regexp.cap(2).toLatin1();
+ d->args = regexp.cap(3).toLatin1();
// d->argList = QStringList::split(' ', d->args);
- d->suffix = regexp.cap(4).latin1();
+ d->suffix = regexp.cap(4).toLatin1();
#ifndef KIRC_STRICT
extractCtcpCommand();
@@ -416,19 +416,19 @@
message.truncate(0);
msg.d->ctcpMessage = new Message(msg.d->engine);
- msg.d->ctcpMessage->d->raw = msg.d->ctcpRaw.latin1();
+ msg.d->ctcpMessage->d->raw = msg.d->ctcpRaw.toLatin1();
int space = msg.d->ctcpRaw.find(' ');
if (!matchForIRCRegExp(msg.d->ctcpMessage->d->raw, codec, *msg.d->ctcpMessage))
{
if (space > 0)
- msg.d->ctcpMessage->d->command = msg.d->ctcpRaw.mid(0, space).upper();
+ msg.d->ctcpMessage->d->command = msg.d->ctcpRaw.mid(0, space).toUpper();
else
- msg.d->ctcpMessage->d->command = msg.d->ctcpRaw.upper();
+ msg.d->ctcpMessage->d->command = msg.d->ctcpRaw.toUpper();
}
if (space > 0)
- msg.d->ctcpMessage->d->ctcpRaw = msg.d->ctcpRaw.mid(space).latin1();
+ msg.d->ctcpMessage->d->ctcpRaw = msg.d->ctcpRaw.mid(space).toLatin1();
return true;
}
Index: protocols/irc/libkirc/kircengine_commands.cpp
===================================================================
--- protocols/irc/libkirc/kircengine_commands.cpp (revision 681822)
+++ protocols/irc/libkirc/kircengine_commands.cpp (working copy)
@@ -227,7 +227,7 @@
QString message;
- if (oldNick.lower() == m_Nickname.lower())
+ if (oldNick.toLower() == m_Nickname.toLower())
{
m_Nickname = msg.suffix();
message = i18n("Your nick has changed from %1 to %2");
Index: protocols/irc/libkirc/plugins/ctcp/kircctcpmessages.cpp
===================================================================
--- protocols/irc/libkirc/plugins/ctcp/kircctcpmessages.cpp (revision 681822)
+++ protocols/irc/libkirc/plugins/ctcp/kircctcpmessages.cpp (working copy)
@@ -107,7 +107,7 @@
TransferServer *server = TransferHandler::self()->createServer(this, nickname, type, fileName, file.size());
QString ip = m_sock->localAddress()->nodeName();
- QString ipNumber = QString::number( ntohl( inet_addr( ip.latin1() ) ) );
+ QString ipNumber = QString::number( ntohl( inet_addr( ip.toLatin1() ) ) );
kDebug(14120) << "Starting DCC file outgoing transfer." << endl;
Index: protocols/irc/libkirc/plugins/ctcp/kirctransfer.cpp
===================================================================
--- protocols/irc/libkirc/plugins/ctcp/kirctransfer.cpp (revision 681822)
+++ protocols/irc/libkirc/plugins/ctcp/kirctransfer.cpp (working copy)
@@ -284,11 +284,11 @@
{
kDebug(14121) << k_funcinfo << endl;
- m_bufferLength = m_socket->readBlock(m_buffer, sizeof(m_buffer));
+ m_bufferLength = m_socket->read(m_buffer, sizeof(m_buffer));
if(m_bufferLength > 0)
{
- int written = m_file.writeBlock(m_buffer, m_bufferLength);
+ int written = m_file.write(m_buffer, m_bufferLength);
if(m_bufferLength == written)
{
m_fileSizeCur += written;
@@ -331,10 +331,10 @@
if (m_fileSizeAck < m_fileSize)
{
- m_bufferLength = m_file.readBlock(m_buffer, sizeof(m_buffer));
+ m_bufferLength = m_file.read(m_buffer, sizeof(m_buffer));
if (m_bufferLength > 0)
{
- quint32 read = m_socket->writeBlock(m_buffer, m_bufferLength); // should check written == read
+ quint32 read = m_socket->write(m_buffer, m_bufferLength); // should check written == read
// if(read != m_buffer_length)
// buffer is not cleared still
Index: protocols/irc/libkirc/kircengine_ctcp.cpp
===================================================================
--- protocols/irc/libkirc/kircengine_ctcp.cpp (revision 681822)
+++ protocols/irc/libkirc/kircengine_ctcp.cpp (working copy)
@@ -159,7 +159,7 @@
TransferServer *server = TransferHandler::self()->createServer(this, nickname, type, fileName, file.size());
QString ip = m_sock->localAddress()->nodeName();
- QString ipNumber = QString::number( ntohl( inet_addr( ip.latin1() ) ) );
+ QString ipNumber = QString::number( ntohl( inet_addr( ip.toLatin1() ) ) );
kDebug(14120) << "Starting DCC file outgoing transfer." << endl;
@@ -181,7 +181,7 @@
void Engine::CtcpQuery_dcc(Message &msg)
{
Message &ctcpMsg = msg.ctcpMessage();
- QString dccCommand = ctcpMsg.arg(0).upper();
+ QString dccCommand = ctcpMsg.arg(0).toUpper();
if (dccCommand == QString::fromLatin1("CHAT"))
{
Index: protocols/irc/libkirc/client/tasks/kircclienttask.cpp
===================================================================
--- protocols/irc/libkirc/client/tasks/kircclienttask.cpp (revision 681822)
+++ protocols/irc/libkirc/client/tasks/kircclienttask.cpp (working copy)
@@ -1025,7 +1025,7 @@
// Message &ctcpMsg = msg.ctcpMessage();
Message ctcpMsg;
- QString dccCommand = ctcpMsg.arg(0).upper();
+ QString dccCommand = ctcpMsg.arg(0).toUpper();
if (dccCommand == QString::fromLatin1("CHAT"))
{
Index: protocols/irc/libkirc/client/tasks/kirci18ntask.cpp
===================================================================
--- protocols/irc/libkirc/client/tasks/kirci18ntask.cpp (revision 681822)
+++ protocols/irc/libkirc/client/tasks/kirci18ntask.cpp (working copy)
@@ -163,7 +163,7 @@
QString message;
- if (oldNick.lower() == m_Nickname->message().lower())
+ if (oldNick.toLower() == m_Nickname->message().toLower())
{
m_Nickname = e->message().suffix();
message = i18n("Your nick has changed from %1 to %2");
@@ -948,7 +948,7 @@
// Event *&ctcpMsg = e->message().ctcpMessage();
Event *ctcpMsg;
- QString dccCommand = ctcpMsg.arg(0).upper();
+ QString dccCommand = ctcpMsg.arg(0).toUpper();
if (dccCommand == QString::fromLatin1("CHAT"))
{
Index: protocols/irc/libkirc/client/kircclientcommands.cpp
===================================================================
--- protocols/irc/libkirc/client/kircclientcommands.cpp (revision 681822)
+++ protocols/irc/libkirc/client/kircclientcommands.cpp (working copy)
@@ -199,7 +199,7 @@
QString message;
- if (oldNick.lower() == m_Nickname.lower())
+ if (oldNick.toLower() == m_Nickname.toLower())
{
m_Nickname = msg.suffix();
message = i18n("Your nick has changed from %1 to %2");
@@ -1003,7 +1003,7 @@
// Message &ctcpMsg = msg.ctcpMessage();
Message ctcpMsg;
- QString dccCommand = ctcpMsg.arg(0).upper();
+ QString dccCommand = ctcpMsg.arg(0).toUpper();
if (dccCommand == QString::fromLatin1("CHAT"))
{
Index: protocols/irc/irccontact_channel.cpp
===================================================================
--- protocols/irc/irccontact_channel.cpp (revision 681822)
+++ protocols/irc/irccontact_channel.cpp (working copy)
@@ -82,7 +82,7 @@
{
if (!manager(Kopete::Contact::CannotCreate) &&
onlineStatus() == m_protocol->m_ChannelStatusOnline &&
- channel.lower() == m_nickName.lower())
+ channel.toLower() == m_nickName.toLower())
{
mTopic = topic;
setProperty(m_protocol->propChannelMembers, members);
@@ -152,7 +152,7 @@
IRCContact *user;
- if ( nickToAdd.lower() != account->mySelf()->nickName().lower() )
+ if ( nickToAdd.toLower() != account->mySelf()->nickName().toLower() )
{
//kDebug(14120) << k_funcinfo << m_nickName << " NICK: " << nickToAdd << endl;
user = account->contactManager()->findUser(nickToAdd);
@@ -221,7 +221,7 @@
{
IRCAccount *account = ircAccount();
- if( nick.lower() == account->mySelf()->nickName().lower() )
+ if( nick.toLower() == account->mySelf()->nickName().toLower() )
{
IRCUserContact *c = account->mySelf();
if (manager(Kopete::Contact::CannotCreate) && manager()->members().contains(c))
@@ -247,7 +247,7 @@
{
IRCAccount *account = ircAccount();
- if (nickname.lower() == account->mySelf()->nickName().lower())
+ if (nickname.toLower() == account->mySelf()->nickName().toLower())
{
kDebug() << k_funcinfo << "Me:" << this << endl;
kDebug() << k_funcinfo << "My nickname:" << m_nickName << endl;
@@ -279,7 +279,7 @@
{
IRCAccount *account = ircAccount();
- if (nickname.lower() != account->engine()->nickName().lower())
+ if (nickname.toLower() != account->engine()->nickName().toLower())
{
Kopete::Contact *c = locateUser( nickname );
if ( c )
@@ -299,7 +299,7 @@
if (reason != nick)
r.append( i18n(" Reason: %2").arg( reason ) );
- if( nickKicked.lower() != account->engine()->nickName().lower() )
+ if( nickKicked.toLower() != account->engine()->nickName().toLower() )
{
Kopete::Contact *c = locateUser( nickKicked );
if (c)
Index: protocols/irc/irccontact.cpp
===================================================================
--- protocols/irc/irccontact.cpp (revision 681822)
+++ protocols/irc/irccontact.cpp (working copy)
@@ -219,7 +219,7 @@
if (test)
codec = QTextCodec::codecForMib(mib);
else
- codec = QTextCodec::codecForName(codecId.latin1());
+ codec = QTextCodec::codecForName(codecId.toLatin1());
}
if (!codec)
Index: protocols/irc/ksparser.cpp
===================================================================
--- protocols/irc/ksparser.cpp (revision 681822)
+++ protocols/irc/ksparser.cpp (working copy)
@@ -193,7 +193,7 @@
break;
default:
if (car < QChar(' ')) // search for control characters
- ret += QString::fromLatin1("<%1>").arg(car, 2, 16).upper();
+ ret += QString::fromLatin1("<%1>").arg(car, 2, 16).toUpper();
else
ret += car;
}
Index: kopete/chatwindow/chatmessagepart.cpp
===================================================================
--- kopete/chatwindow/chatmessagepart.cpp (revision 681822)
+++ kopete/chatwindow/chatmessagepart.cpp (working copy)
@@ -39,6 +39,7 @@
#include <QtGui/QCursor>
#include <QtGui/QPixmap>
#include <QtGui/QTextDocument>
+#include <QMimeData>
#include <QApplication>
// KHTML::DOM includes
@@ -62,12 +63,11 @@
#include <krun.h>
#include <kstringhandler.h>
#include <ktemporaryfile.h>
-#include <kio/netaccess.h>
+#include <kio/copyjob.h>
#include <kstandarddirs.h>
#include <kstandardaction.h>
#include <kiconloader.h>
#include <kcodecs.h>
-#include <k3multipledrag.h>
#include <kstandardaction.h>
#include <kicon.h>
@@ -299,14 +299,16 @@
}
else
{
- stream << htmlDocument().toHTML() << '\n';
+ stream << htmlDocument().toString().string() << '\n';
}
stream.flush();
QString fileName = tempFile->fileName();
delete tempFile;
- if ( !KIO::NetAccess::move( KUrl( fileName ), saveURL ) )
+ KIO::CopyJob *moveJob = KIO::move( KUrl( fileName ), saveURL, false );
+
+ if ( !moveJob )
{
KMessageBox::queuedMessageBox( view(), KMessageBox::Error,
i18n("<qt>Could not open <b>%1</b> for writing.</qt>", saveURL.prettyUrl() ), // Message
@@ -748,9 +750,9 @@
htmltext = selectedTextAsHTML();
text = selectedText();
//selectedText is now sufficient
-// text=Kopete::Message::unescape( htmltext ).stripWhiteSpace();
+// text=Kopete::Message::unescape( htmltext ).trimmed();
// Message::unsescape will replace image by his title attribute
- // stripWhiteSpace is for removing the newline added by the <!DOCTYPE> and other xml things of RangeImpl::toHTML
+ // trimmed is for removing the newline added by the <!DOCTYPE> and other xml things of RangeImpl::toHTML
if(text.isEmpty()) return;
@@ -759,21 +761,20 @@
#ifndef QT_NO_MIMECLIPBOARD
if(!justselection)
{
- Q3TextDrag *textdrag = new Q3TextDrag(text, 0L);
- K3MultipleDrag *drag = new K3MultipleDrag( );
- drag->addDragObject( textdrag );
- if(!htmltext.isEmpty()) {
- htmltext.replace( QChar( 0xa0 ), ' ' );
- Q3TextDrag *htmltextdrag = new Q3TextDrag(htmltext, 0L);
- htmltextdrag->setSubtype("html");
- drag->addDragObject( htmltextdrag );
- }
- QApplication::clipboard()->setData( drag, QClipboard::Clipboard );
+ QMimeData *mimeData = new QMimeData();
+ mimeData->setText(text);
+
+ if(!htmltext.isEmpty()) {
+ htmltext.replace( QChar( 0xa0 ), ' ' );
+ mimeData->setHtml(htmltext);
+ }
+
+ QApplication::clipboard()->setMimeData( mimeData, QClipboard::Clipboard );
}
- QApplication::clipboard()->setText( text, QClipboard::Selection );
+ QApplication::clipboard()->setText( text, QClipboard::Selection );
#else
if(!justselection)
- QApplication::clipboard()->setText( text, QClipboard::Clipboard );
+ QApplication::clipboard()->setText( text, QClipboard::Clipboard );
QApplication::clipboard()->setText( text, QClipboard::Selection );
#endif
connect( QApplication::clipboard(), SIGNAL( selectionChanged()), SLOT( slotClearSelection()));
@@ -1194,4 +1195,3 @@
#include "chatmessagepart.moc"
// vim: set noet ts=4 sts=4 sw=4:
-
Index: libkopete/avdevice/videodevice.cpp
===================================================================
--- libkopete/avdevice/videodevice.cpp (revision 681822)
+++ libkopete/avdevice/videodevice.cpp (working copy)
@@ -402,7 +402,7 @@
kDebug() << k_funcinfo << " Max res: " << maxWidth() << " x " << maxHeight() << endl;
kDebug() << k_funcinfo << " Min res: " << minWidth() << " x " << minHeight() << endl;
kDebug() << k_funcinfo << " Inputs : " << inputs() << endl;
- for (unsigned int loop=0; loop < inputs(); loop++)
+ for (int loop=0; loop < inputs(); loop++)
kDebug() << k_funcinfo << "Input " << loop << ": " << m_input[loop].name << " (tuner: " << m_input[loop].hastuner << ")" << endl;
kDebug() << k_funcinfo << "showDeviceCapabilities() exited successfuly." << endl;
return EXIT_SUCCESS;
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ kopete-devel mailing list [email protected] https://mail.kde.org/mailman/listinfo/kopete-devel
