[prev in list] [next in list] [prev in thread] [next in thread]
List: kopete-devel
Subject: Re: [kopete-devel] SMS Port-dead-end...
From: "Michael D. Stemle, Jr." <manchicken () notsosoft ! net>
Date: 2006-07-29 16:47:50
Message-ID: 200607291147.51637.manchicken () notsosoft ! net
[Download RAW message or body]
Yay. I'm batting a thousand! My old meta-contact patch got into the last
one, too (perhaps I should be looking before submitting patches?). Here's
the updated one.
On Saturday 29 July 2006 11:29, Michael D. Stemle, Jr. wrote:
> Okay, so yeah, in my infinite wisdom I ported the wrong function for the
> last patch. I've corrected this. Here's the new patch.
>
> On Saturday 29 July 2006 10:40, Michael D. Stemle, Jr. wrote:
> > Okay... I have no idea what to do with this now that I've got it
> > compiling, linking, and loading. I figure I'll send the patch out and
> > let y'all do with it what you will.
> >
> > If someone can give me more ideas on how to work with it, I'd have no
> > problem doing so, but as it stands I'm clueless. I'm gonna move onto
> > something else for the time being.
--
~ Michael D. Stemle, Jr. <><
(A)bort, (R)etry, (I)nfluence with large hammer
["20060729-sms_port.svn-diff" (text/x-diff)]
Index: kopete/protocols/sms/services/smsclient.cpp
===================================================================
--- kopete/protocols/sms/services/smsclient.cpp (revision 567639)
+++ kopete/protocols/sms/services/smsclient.cpp (working copy)
@@ -61,7 +61,7 @@
m_msg = msg;
KConfigGroup* c = m_account->configGroup();
- QString provider = \
c->readEntry(QString("%1:%2").arg("SMSClient").arg("ProviderName"), QString::null); \
+ QString provider = \
c->readEntry(QString("%1:%2").arg("SMSClient").arg("ProviderName"), QString());
if (provider.isNull())
{
@@ -69,7 +69,7 @@
return;
}
- QString programName = \
c->readEntry(QString("%1:%2").arg("SMSClient").arg("ProgramName"). QString::null); \
+ QString programName = \
c->readEntry(QString("%1:%2").arg("SMSClient").arg("ProgramName"), QString()); if \
(programName.isNull()) programName = "/usr/bin/sms_client";
@@ -99,7 +99,7 @@
prefWidget->configDir->setMode(KFile::Directory);
QString configDir;
if (m_account)
- configDir = m_account->configGroup()->readEntry(QString("%1:%2").arg("SMSClient").arg("ConfigDir"), \
QString::null); + configDir = \
m_account->configGroup()->readEntry(QString("%1:%2").arg("SMSClient").arg("ConfigDir"), \
QString()); if (configDir.isNull())
configDir = "/etc/sms";
prefWidget->configDir->setUrl(configDir);
@@ -107,7 +107,7 @@
QString programName;
if (m_account)
programName = m_account->configGroup()->readEntry(QString("%1:%2").arg("SMSClient").arg("ProgramName"),
- QString::null);
+ QString());
if (programName.isNull())
programName = "/usr/bin/sms_client";
prefWidget->program->setUrl(programName);
@@ -116,7 +116,7 @@
if (m_account)
{
- QString pName = m_account->configGroup()->readEntry(QString("%1:%2").arg("SMSClient").arg("ProviderName"));
+ QString pName = m_account->configGroup()->readEntry(QString("%1:%2").arg("SMSClient").arg("ProviderName"), \
QString()); for (int i=0; i < prefWidget->provider->count(); i++)
{
if (prefWidget->provider->text(i) == pName)
@@ -138,8 +138,8 @@
{
KConfigGroup* c = m_account->configGroup();
- c->writeEntry(QString("%1:%2").arg("SMSClient").arg("ProgramName"), \
prefWidget->program->url());
- c->writeEntry(QString("%1:%2").arg("SMSClient").arg("ConfigDir"), \
prefWidget->configDir->url()); \
+ c->writeEntry(QString("%1:%2").arg("SMSClient").arg("ProgramName"), \
prefWidget->program->url().url()); \
+ c->writeEntry(QString("%1:%2").arg("SMSClient").arg("ConfigDir"), \
prefWidget->configDir->url().url()); \
c->writeEntry(QString("%1:%2").arg("SMSClient").arg("ProviderName"), \
prefWidget->provider->currentText()); }
}
Index: kopete/protocols/sms/services/smssend.cpp
===================================================================
--- kopete/protocols/sms/services/smssend.cpp (revision 567639)
+++ kopete/protocols/sms/services/smssend.cpp (working copy)
@@ -51,7 +51,7 @@
void SMSSend::send(const Kopete::Message& msg)
{
kWarning( 14160 ) << k_funcinfo << "m_account = " << m_account << " (should be \
non-zero!!)" << endl;
- QString provider = m_account->configGroup()->readEntry("SMSSend:ProviderName", \
QString::null); + QString provider = \
m_account->configGroup()->readEntry("SMSSend:ProviderName", QString());
if (provider.length() < 1)
{
@@ -59,7 +59,7 @@
return;
}
- QString prefix = m_account->configGroup()->readEntry("SMSSend:Prefix", \
QString::null); + QString prefix = \
m_account->configGroup()->readEntry("SMSSend:Prefix", QString()); if \
(prefix.isNull()) {
KMessageBox::error(Kopete::UI::Global::mainWidget(), i18n("No prefix set for \
SMSSend, please change it in the configuration dialog."), i18n("No Prefix")); @@ \
-90,7 +90,7 @@ QString prefix = QString::null;
if (m_account)
- prefix = m_account->configGroup()->readEntry("SMSSend:Prefix", QString::null);
+ prefix = m_account->configGroup()->readEntry("SMSSend:Prefix", QString());
if (prefix.isNull())
{
QDir d("/usr/share/smssend");
@@ -124,7 +124,7 @@
{
if (prefWidget != 0L && m_account != 0L && m_provider != 0L )
{
- m_account->configGroup()->writeEntry("SMSSend:Prefix", \
prefWidget->program->url()); \
+ m_account->configGroup()->writeEntry("SMSSend:Prefix", \
prefWidget->program->url().url()); \
m_account->configGroup()->writeEntry("SMSSend:ProviderName", \
prefWidget->provider->currentText()); m_provider->save(args);
}
@@ -161,7 +161,7 @@
bool found = false;
if (m_account)
- { QString pName = m_account->configGroup()->readEntry("SMSSend:ProviderName", \
QString::null); + { QString pName = \
m_account->configGroup()->readEntry("SMSSend:ProviderName", QString()); for (int \
i=0; i < prefWidget->provider->count(); i++) {
if (prefWidget->provider->text(i) == pName)
@@ -223,10 +223,10 @@
{
kWarning( 14160 ) << k_funcinfo << "m_account = " << m_account << " (should be \
non-zero!!)" << endl;
- QString pName = m_account->configGroup()->readEntry("SMSSend:ProviderName", \
QString::null); + QString pName = \
m_account->configGroup()->readEntry("SMSSend:ProviderName", QString()); if \
(pName.length() < 1) return 160;
- QString prefix = m_account->configGroup()->readEntry("SMSSend:Prefix", \
QString::null); + QString prefix = \
m_account->configGroup()->readEntry("SMSSend:Prefix", QString()); if \
(prefix.isNull()) prefix = "/usr";
// quick sanity check
Index: kopete/protocols/sms/services/gsmlib.cpp
===================================================================
--- kopete/protocols/sms/services/gsmlib.cpp (revision 567639)
+++ kopete/protocols/sms/services/gsmlib.cpp (working copy)
@@ -323,7 +323,7 @@
QString temp;
KConfigGroup* c = m_account->configGroup();
- temp = c->readEntry(QString("%1:%2").arg("GSMLib").arg("Device"), QString::null);
+ temp = c->readEntry(QString("%1:%2").arg("GSMLib").arg("Device"), QString());
if( temp != QString::null )
m_device = temp;
}
Index: kopete/protocols/sms/services/smssendprovider.cpp
===================================================================
--- kopete/protocols/sms/services/smssendprovider.cpp (revision 567639)
+++ kopete/protocols/sms/services/smssendprovider.cpp (working copy)
@@ -91,7 +91,7 @@
descriptions.append(args[1]);
if (m_account)
values.append(m_account->configGroup()->readEntry(QString("%1:%2").arg(group).arg(names[names.count()-1]),
- QString::null));
+ QString()));
else
values.append("");
Index: kopete/protocols/sms/services/CMakeLists.txt
===================================================================
--- kopete/protocols/sms/services/CMakeLists.txt (revision 567639)
+++ kopete/protocols/sms/services/CMakeLists.txt (working copy)
@@ -1,11 +1,22 @@
-
-
-
-
########### next target ###############
+include_directories( .. )
+set( kopete_sms_services_SRCS
+ gsmlib.cpp
+ kopete_unix_serial.cpp
+ smsclient.cpp
+ smssend.cpp
+ smssendprovider.cpp )
+kde4_automoc(${kopete_sms_services_SRCS})
+kde4_add_ui3_files( kopete_sms_services_SRCS
+ gsmlibprefs.ui
+ smsclientprefs.ui
+ smssendprefs.ui )
+#kde4_add_library( kopetesmsservices SHARED ${kopete_sms_services_SRCS} )
+#target_link_libraries(kopetesmsservices ${KDE4_KIO_LIBS} kopete )
########### install files ###############
+install(TARGETS kopetesmsservices DESTINATION ${PLUGIN_INSTALL_DIR})
Index: kopete/protocols/sms/smscontact.cpp
===================================================================
--- kopete/protocols/sms/smscontact.cpp (revision 567639)
+++ kopete/protocols/sms/smscontact.cpp (working copy)
@@ -20,6 +20,7 @@
#include <kdebug.h>
#include <klocale.h>
#include <kmessagebox.h>
+#include <kactioncollection.h>
#include "kopetechatsessionmanager.h"
#include "kopeteaccount.h"
@@ -119,13 +120,27 @@
new SMSContact(account(), phoneNumber, nickName(), metaContact());
}
-QList<KAction*>* SMSContact::customContextMenuActions()
+KActionCollection* SMSContact::customContextMenuActions(QWidget *parent)
{
- QList<KAction*> *m_actionCollection = new QList<KAction*>();
+ KActionCollection *m_actionCollection = new KActionCollection(parent);
+
if( !m_actionPrefs )
- m_actionPrefs = new KAction(i18n("&Contact Settings"), 0, this, SLOT(userPrefs()), \
this, "userPrefs"); + {
+ m_actionPrefs = new KAction(i18n("&Contact Settings"),
+ m_actionCollection,
+ "userPrefs");
+
+// dynamic_cast<QObject*>(this),
+// SLOT(userPrefs()),
+// dynamic_cast<QObject*>(this),
+// "userPrefs");
+ QObject::connect(m_actionPrefs,
+ SIGNAL(triggered(bool)),
+ dynamic_cast<QObject*>(this),
+ SLOT(userPrefs()));
+ }
- m_actionCollection->append( m_actionPrefs );
+ m_actionCollection->insert( m_actionPrefs );
return m_actionCollection;
}
Index: kopete/protocols/sms/smsaccount.cpp
===================================================================
--- kopete/protocols/sms/smsaccount.cpp (revision 567639)
+++ kopete/protocols/sms/smsaccount.cpp (working copy)
@@ -35,13 +35,13 @@
#include "smscontact.h"
SMSAccount::SMSAccount( SMSProtocol *parent, const QString &accountID, const char \
*name )
- : Kopete::Account( parent, accountID, name )
+ : Kopete::Account( parent, accountID )
{
setMyself( new SMSContact(this, accountID, accountID, \
Kopete::ContactList::self()->myself()) ); loadConfig();
myself()->setOnlineStatus( SMSProtocol::protocol()->SMSOffline );
- QString sName = configGroup()->readEntry("ServiceName", QString::null);
+ QString sName = configGroup()->readEntry("ServiceName", QString());
theService = ServiceLoader::loadService(sName, this);
if( theService )
@@ -65,7 +65,7 @@
void SMSAccount::loadConfig()
{
theSubEnable = configGroup()->readEntry("SubEnable", false);
- theSubCode = configGroup()->readEntry("SubCode", QString::null);
+ theSubCode = configGroup()->readEntry("SubCode", QString());
theLongMsgAction = (SMSMsgAction)configGroup()->readEntry("MsgAction", 0);
}
@@ -184,16 +184,21 @@
return theActionMenu;
}
-void SMSAccount::setOnlineStatus( const Kopete::OnlineStatus & status , const \
QString &reason) +void SMSAccount::setOnlineStatus( const Kopete::OnlineStatus & \
status , const Kopete::StatusMessage &reason) {
if ( myself()->onlineStatus().status() == Kopete::OnlineStatus::Offline && \
status.status() == Kopete::OnlineStatus::Online ) connect();
else if ( myself()->onlineStatus().status() != Kopete::OnlineStatus::Offline && \
status.status() == Kopete::OnlineStatus::Offline ) disconnect();
else if ( myself()->onlineStatus().status() != Kopete::OnlineStatus::Offline && \
status.status() == Kopete::OnlineStatus::Away )
- setAway( true, reason );
+ setAway( true, reason.message() );
}
+void SMSAccount::setStatusMessage( const Kopete::StatusMessage& msg )
+{
+ return;
+}
+
SMSService* SMSAccount::service()
{
return theService;
Index: kopete/protocols/sms/smscontact.h
===================================================================
--- kopete/protocols/sms/smscontact.h (revision 567639)
+++ kopete/protocols/sms/smscontact.h (working copy)
@@ -36,7 +36,7 @@
SMSContact( Kopete::Account* _account, const QString &phoneNumber,
const QString &displayName, Kopete::MetaContact *parent );
- QList<KAction*>* customContextMenuActions();
+ KActionCollection* customContextMenuActions(QWidget *parent);
const QString &phoneNumber();
void setPhoneNumber( const QString phoneNumber );
Index: kopete/protocols/sms/smsprotocol.cpp
===================================================================
--- kopete/protocols/sms/smsprotocol.cpp (revision 567639)
+++ kopete/protocols/sms/smsprotocol.cpp (working copy)
@@ -14,6 +14,7 @@
*************************************************************************
*/
+/*#include <Q3Dict>*/
#include <kgenericfactory.h>
#include <kdebug.h>
#include <kconfig.h>
@@ -32,11 +33,11 @@
SMSProtocol* SMSProtocol::s_protocol = 0L;
-SMSProtocol::SMSProtocol(QObject *parent, const QStringList &/*args*/)
-: Kopete::Protocol( SMSProtocolFactory::instance(), parent, name ),
- SMSOnline( Kopete::OnlineStatus::Online, 25, this, 0, QString::null, i18n( \
"Online" ), i18n( "Online" ), Kopete::OnlineStatusManager::Online ),
- SMSConnecting( Kopete::OnlineStatus::Connecting,2, this, 3, QString::null, i18n( \
"Connecting" ) ),
- SMSOffline( Kopete::OnlineStatus::Offline, 0, this, 2, QString::null, i18n( \
"Offline" ), i18n( "Offline" ), Kopete::OnlineStatusManager::Offline ) \
+SMSProtocol::SMSProtocol(QObject *parent, const QStringList &) +: Kopete::Protocol( \
SMSProtocolFactory::instance(), parent ), + SMSOnline( Kopete::OnlineStatus::Online, \
25, this, 0, QStringList(), i18n( "Online" ), i18n( "Online" ), \
Kopete::OnlineStatusManager::Online ), + SMSConnecting( \
Kopete::OnlineStatus::Connecting,2, this, 3, QStringList(), i18n( "Connecting" ) \
), + SMSOffline( Kopete::OnlineStatus::Offline, 0, this, 2, QStringList(), i18n( \
"Offline" ), i18n( "Offline" ), Kopete::OnlineStatusManager::Offline ) {
if (s_protocol)
kWarning( 14160 ) << k_funcinfo << "s_protocol already defined!" << endl;
@@ -74,9 +75,19 @@
QString accountId = serializedData["accountId"];
QString displayName = serializedData["displayName"];
- Q3Dict<Kopete::Account> accounts=Kopete::AccountManager::self()->accounts(this);
+ QList<Kopete::Account*> accounts=Kopete::AccountManager::self()->accounts(this);
- Kopete::Account *account = accounts[accountId];
+ QList<Kopete::Account*>::iterator curacct, lastacct = accounts.end();
+ Kopete::Account *account = (Kopete::Account*) NULL;
+
+ for (curacct = accounts.begin(); curacct != lastacct; curacct++) {
+ Kopete::Account *one = static_cast<Kopete::Account*>(*curacct);
+ if (one->accountId() == accountId) {
+ account = one;
+ break;
+ }
+ }
+
if (!account)
{
kDebug(14160) << "Account doesn't exist, skipping" << endl;
Index: kopete/protocols/sms/smsaddcontactpage.cpp
===================================================================
--- kopete/protocols/sms/smsaddcontactpage.cpp (revision 567639)
+++ kopete/protocols/sms/smsaddcontactpage.cpp (working copy)
@@ -24,8 +24,8 @@
-SMSAddContactPage::SMSAddContactPage(QWidget *parent, const char *name )
- : AddContactPage(parent,name)
+SMSAddContactPage::SMSAddContactPage(QWidget *parent)
+ : AddContactPage(parent)
{
(new Q3VBoxLayout(this))->setAutoAdd(true);
smsdata = new smsAddUI(this);
Index: kopete/protocols/sms/smsaccount.h
===================================================================
--- kopete/protocols/sms/smsaccount.h (revision 567639)
+++ kopete/protocols/sms/smsaccount.h (working copy)
@@ -52,7 +52,8 @@
public slots:
void loadConfig();
- void setOnlineStatus( const Kopete::OnlineStatus& status , const QString &reason = \
QString::null); + void setOnlineStatus( const Kopete::OnlineStatus& status , const \
Kopete::StatusMessage &reason); + void setStatusMessage( const \
Kopete::StatusMessage& msg );
public slots:
virtual void connect(const Kopete::OnlineStatus& initial= Kopete::OnlineStatus());
Index: kopete/protocols/sms/smseditaccountwidget.cpp
===================================================================
--- kopete/protocols/sms/smseditaccountwidget.cpp (revision 567639)
+++ kopete/protocols/sms/smseditaccountwidget.cpp (working copy)
@@ -59,9 +59,9 @@
//Disable changing the account ID for now
//FIXME: Remove this when we can safely change the account ID (Matt)
preferencesDialog->accountId->setDisabled(true);
- sName = account->configGroup()->readEntry("ServiceName", QString::null);
+ sName = account->configGroup()->readEntry("ServiceName", QString());
preferencesDialog->subEnable->setChecked(account->configGroup()->readEntry("SubEnable", \
false));
- preferencesDialog->subCode->setText(account->configGroup()->readEntry("SubCode", \
QString::null)); + preferencesDialog->subCode->setText(account->configGroup()->readEntry("SubCode", \
QString())); preferencesDialog->ifMessageTooLong->setCurrentItem(SMSMsgAction(account->configGroup()->readEntry("MsgAction", \
0))); }
Index: kopete/protocols/sms/smsaddcontactpage.h
===================================================================
--- kopete/protocols/sms/smsaddcontactpage.h (revision 567639)
+++ kopete/protocols/sms/smsaddcontactpage.h (working copy)
@@ -27,7 +27,7 @@
{
Q_OBJECT
public:
- SMSAddContactPage(QWidget *parent=0, const char *name=0);
+ SMSAddContactPage(QWidget *parent=0);
~SMSAddContactPage();
smsAddUI *smsdata;
virtual bool validateData();
Index: kopete/protocols/sms/ui/CMakeLists.txt
===================================================================
--- kopete/protocols/sms/ui/CMakeLists.txt (revision 567639)
+++ kopete/protocols/sms/ui/CMakeLists.txt (working copy)
@@ -3,9 +3,16 @@
########### next target ###############
+set( uiSrcs empty.cpp )
+kde4_add_ui3_files ( uiSrcs
+ smsactprefs.ui
+ smsuserprefs.ui
+ smsadd.ui )
+kde4_add_library( kopetesmsui SHARED ${uiSrcs} )
+target_link_libraries(kopetesmsui ${KDE4_KIO_LIBS} )
-
########### install files ###############
+install(TARGETS kopetesmsui DESTINATION ${PLUGIN_INSTALL_DIR})
Index: kopete/protocols/sms/CMakeLists.txt
===================================================================
--- kopete/protocols/sms/CMakeLists.txt (revision 567639)
+++ kopete/protocols/sms/CMakeLists.txt (working copy)
@@ -1,31 +1,52 @@
-add_subdirectory( ui )
-add_subdirectory( services )
+#add_subdirectory( ui )
+#add_subdirectory( services )
add_subdirectory( icons )
+include_directories( ui services )
-
########### next target ###############
+# set(kopete_sms_ui_SRCS)
+# kde4_add_ui3_files ( kopete_sms_ui_SRCS
+# ui/smsactprefs.ui
+# ui/smsuserprefs.ui
+# ui/smsadd.ui )
+
set(kopete_sms_PART_SRCS
- smsaddcontactpage.cpp
- smscontact.cpp
- smseditaccountwidget.cpp
- smsprotocol.cpp
- serviceloader.cpp
- smsservice.cpp
- smsuserpreferences.cpp
- smsaccount.cpp )
+ smsaddcontactpage.cpp
+ smscontact.cpp
+ smseditaccountwidget.cpp
+ smsprotocol.cpp
+ serviceloader.cpp
+ smsservice.cpp
+ smsuserpreferences.cpp
+ smsaccount.cpp
+ services/gsmlib.cpp
+ services/kopete_unix_serial.cpp
+ services/smsclient.cpp
+ services/smssend.cpp
+ services/smssendprovider.cpp
+ ui/empty.cpp )
+kde4_add_ui3_files( kopete_sms_PART_SRCS
+ services/gsmlibprefs.ui
+ services/smsclientprefs.ui
+ services/smssendprefs.ui
+ ui/smsactprefs.ui
+ ui/smsuserprefs.ui
+ ui/smsadd.ui )
+
kde4_automoc(${kopete_sms_PART_SRCS})
kde4_add_plugin(kopete_sms ${kopete_sms_PART_SRCS})
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} kopete_sms )
-target_link_libraries(kopete_sms ${KDE4_KIO_LIBS} kopetesmsui kopetesmsservices \
kopete ) +target_link_libraries(kopete_sms ${KDE4_KIO_LIBS} kopete )
+kde4_add_library( kopete_sms SHARED ${kopete_sms_PART_SRCS} )
install(TARGETS kopete_sms DESTINATION ${PLUGIN_INSTALL_DIR})
Index: kopete/protocols/CMakeLists.txt
===================================================================
--- kopete/protocols/CMakeLists.txt (revision 567639)
+++ kopete/protocols/CMakeLists.txt (working copy)
@@ -2,7 +2,7 @@
option(WITH_testbed "Enable Kopete testbed protocol" ON)
option(WITH_messenger "Enable Kopete MSN/Windows Live Messenger protocol" ON)
-
+option(WITH_sms "Enable Kopete SMS protocol" ON)
include_directories(${KOPETE_INCLUDES})
add_subdirectory( msn )
@@ -26,6 +26,10 @@
add_subdirectory( testbed )
endif(WITH_testbed)
+if(WITH_sms)
+ add_subdirectory( sms )
+endif(WITH_sms)
+
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: Disabled IRC, Groupwise, SMS and \
Meanwhile for compiling, because they are not ported right now. I leave that to the \
protocol maintainer (-DarkShock)")
Index: kopete/libkopete/CMakeLists.txt
===================================================================
--- kopete/libkopete/CMakeLists.txt (revision 567639)
+++ kopete/libkopete/CMakeLists.txt (working copy)
@@ -113,6 +113,7 @@
kde4_add_library(kopete SHARED ${kopete_LIB_SRCS})
+message("KDE4_KABC_LIBS: " ${KDE4_KABC_LIBS})
target_link_libraries(kopete ${KDE4_KDE3SUPPORT_LIBS} ${KDE4_KABC_LIBS} \
${X11_Xss_LIB} )
if(X11_Xrender_FOUND)
_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic