mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-10 16:14:40 +02:00
add a google wrapper around the jreen jabber plugin
This commit is contained in:
@@ -42,21 +42,21 @@ JabberPlugin::setProxy( QNetworkProxy* proxy )
|
|||||||
|
|
||||||
|
|
||||||
const QString
|
const QString
|
||||||
JabberPlugin::name()
|
JabberPlugin::name() const
|
||||||
{
|
{
|
||||||
return QString( MYNAME );
|
return QString( MYNAME );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const QString
|
const QString
|
||||||
JabberPlugin::friendlyName()
|
JabberPlugin::friendlyName() const
|
||||||
{
|
{
|
||||||
return QString( "Jabber" );
|
return QString( "Jabber" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const QString
|
const QString
|
||||||
JabberPlugin::accountName()
|
JabberPlugin::accountName() const
|
||||||
{
|
{
|
||||||
return TomahawkSettings::instance()->jabberUsername();
|
return TomahawkSettings::instance()->jabberUsername();
|
||||||
}
|
}
|
||||||
|
@@ -37,10 +37,10 @@ public:
|
|||||||
virtual ~JabberPlugin() { delete p; }
|
virtual ~JabberPlugin() { delete p; }
|
||||||
|
|
||||||
//FIXME: Make this more correct
|
//FIXME: Make this more correct
|
||||||
virtual bool isValid() { return true; }
|
virtual bool isValid() const { return true; }
|
||||||
virtual const QString name();
|
virtual const QString name() const;
|
||||||
virtual const QString friendlyName();
|
virtual const QString friendlyName() const;
|
||||||
virtual const QString accountName();
|
virtual const QString accountName() const;
|
||||||
virtual QMenu* menu();
|
virtual QMenu* menu();
|
||||||
|
|
||||||
void setProxy( QNetworkProxy* proxy );
|
void setProxy( QNetworkProxy* proxy );
|
||||||
|
@@ -51,3 +51,6 @@ IF( APPLE )
|
|||||||
ENDIF( APPLE )
|
ENDIF( APPLE )
|
||||||
|
|
||||||
install( TARGETS tomahawk_sipjabber DESTINATION lib${LIB_SUFFIX} )
|
install( TARGETS tomahawk_sipjabber DESTINATION lib${LIB_SUFFIX} )
|
||||||
|
|
||||||
|
|
||||||
|
add_subdirectory(googlewrapper)
|
31
src/sip/jreen/googlewrapper/CMakeLists.txt
Normal file
31
src/sip/jreen/googlewrapper/CMakeLists.txt
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
# fake google plugin
|
||||||
|
|
||||||
|
set( googleHeaders
|
||||||
|
../jabber.h
|
||||||
|
../tomahawksipmessage.h
|
||||||
|
../tomahawksipmessagefactory.h
|
||||||
|
../avatarmanager.h
|
||||||
|
googlewrapper.h )
|
||||||
|
|
||||||
|
set( googleSources
|
||||||
|
../jabber.cpp
|
||||||
|
../jabber_p.cpp
|
||||||
|
../tomahawksipmessage.cpp
|
||||||
|
../tomahawksipmessagefactory.cpp
|
||||||
|
../avatarmanager.cpp
|
||||||
|
googlewrapper.cpp )
|
||||||
|
|
||||||
|
add_definitions(-DGOOGLE_WRAPPER)
|
||||||
|
|
||||||
|
qt4_wrap_cpp( googleMoc googlewrapper.h )
|
||||||
|
add_library( tomahawk_sipgoogle SHARED ${googleSources} ${googleMoc} ${jabberMoc} )
|
||||||
|
|
||||||
|
target_link_libraries( tomahawk_sipgoogle
|
||||||
|
${QT_LIBRARIES}
|
||||||
|
${LIBJREEN_LIBRARY}
|
||||||
|
${OS_SPECIFIC_LINK_LIBRARIES}
|
||||||
|
tomahawklib
|
||||||
|
)
|
||||||
|
|
||||||
|
install( TARGETS tomahawk_sipgoogle DESTINATION lib${LIB_SUFFIX} )
|
37
src/sip/jreen/googlewrapper/googlewrapper.cpp
Normal file
37
src/sip/jreen/googlewrapper/googlewrapper.cpp
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) 2011 Leo Franchi <leo.franchi@kdab.com>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "googlewrapper.h"
|
||||||
|
#include <QtPlugin>
|
||||||
|
|
||||||
|
SipPlugin*
|
||||||
|
GoogleWrapperFactory::createPlugin( const QString& pluginId )
|
||||||
|
{
|
||||||
|
return new GoogleWrapper( pluginId.isEmpty() ? generateId() : pluginId );
|
||||||
|
}
|
||||||
|
|
||||||
|
GoogleWrapper::GoogleWrapper ( const QString& pluginID )
|
||||||
|
: JabberPlugin ( pluginID )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef GOOGLE_WRAPPER
|
||||||
|
Q_EXPORT_PLUGIN2( sipfactory, GoogleWrapperFactory )
|
||||||
|
#endif
|
49
src/sip/jreen/googlewrapper/googlewrapper.h
Normal file
49
src/sip/jreen/googlewrapper/googlewrapper.h
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
Copyright (C) 2011 Leo Franchi <leo.franchi@kdab.com>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef GOOGLEWRAPPER_H
|
||||||
|
#define GOOGLEWRAPPER_H
|
||||||
|
|
||||||
|
#include "sip/jreen/jabber.h"
|
||||||
|
|
||||||
|
class SIPDLLEXPORT GoogleWrapperFactory : public SipPluginFactory
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_INTERFACES( SipPluginFactory )
|
||||||
|
|
||||||
|
public:
|
||||||
|
GoogleWrapperFactory() {}
|
||||||
|
virtual ~GoogleWrapperFactory() {}
|
||||||
|
|
||||||
|
virtual QString prettyName() const { return "GMail"; }
|
||||||
|
virtual QString factoryId() const { return "sipgoogle"; }
|
||||||
|
virtual SipPlugin* createPlugin( const QString& pluginId );
|
||||||
|
};
|
||||||
|
|
||||||
|
class SIPDLLEXPORT GoogleWrapper : public JabberPlugin
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
GoogleWrapper( const QString& pluginID );
|
||||||
|
virtual ~GoogleWrapper() {}
|
||||||
|
|
||||||
|
virtual const QString name() const { return QString( "GMail" ); }
|
||||||
|
virtual const QString friendlyName() const { return "GMail Friends"; }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // GOOGLEWRAPPER_H
|
@@ -291,5 +291,6 @@ JabberPlugin::connectionState() const
|
|||||||
return m_state;
|
return m_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GOOGLE_WRAPPER
|
||||||
Q_EXPORT_PLUGIN2( sipfactory, JabberFactory )
|
Q_EXPORT_PLUGIN2( sipfactory, JabberFactory )
|
||||||
|
#endif
|
@@ -36,8 +36,8 @@ public:
|
|||||||
JabberFactory() {}
|
JabberFactory() {}
|
||||||
virtual ~JabberFactory() {}
|
virtual ~JabberFactory() {}
|
||||||
|
|
||||||
virtual QString prettyName() { return "Jabber"; }
|
virtual QString prettyName() const { return "Jabber"; }
|
||||||
virtual QString factoryId() { return "sipjabber"; }
|
virtual QString factoryId() const { return "sipjabber"; }
|
||||||
virtual SipPlugin* createPlugin( const QString& pluginId );
|
virtual SipPlugin* createPlugin( const QString& pluginId );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -49,8 +49,8 @@ public:
|
|||||||
TwitterFactory() {}
|
TwitterFactory() {}
|
||||||
virtual ~TwitterFactory() {}
|
virtual ~TwitterFactory() {}
|
||||||
|
|
||||||
virtual QString prettyName() { return "Twitter"; }
|
virtual QString prettyName() const { return "Twitter"; }
|
||||||
virtual QString factoryId() { return "siptwitter"; }
|
virtual QString factoryId() const { return "siptwitter"; }
|
||||||
virtual SipPlugin* createPlugin( const QString& pluginId = QString() );
|
virtual SipPlugin* createPlugin( const QString& pluginId = QString() );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -37,13 +37,13 @@ ZeroconfPlugin::name() const
|
|||||||
const QString
|
const QString
|
||||||
ZeroconfPlugin::accountName() const
|
ZeroconfPlugin::accountName() const
|
||||||
{
|
{
|
||||||
return QString();
|
return QString( MYNAME );
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString
|
const QString
|
||||||
ZeroconfPlugin::friendlyName() const
|
ZeroconfPlugin::friendlyName() const
|
||||||
{
|
{
|
||||||
return QString( "Zeroconf" );
|
return QString( MYNAME );
|
||||||
}
|
}
|
||||||
|
|
||||||
SipPlugin::ConnectionState
|
SipPlugin::ConnectionState
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include "../sipdllmacro.h"
|
#include "../sipdllmacro.h"
|
||||||
|
|
||||||
#define MYNAME "Local Netwrok"
|
#define MYNAME "Local Network"
|
||||||
|
|
||||||
class SIPDLLEXPORT ZeroconfFactory : public SipPluginFactory
|
class SIPDLLEXPORT ZeroconfFactory : public SipPluginFactory
|
||||||
{
|
{
|
||||||
@@ -34,8 +34,8 @@ public:
|
|||||||
ZeroconfFactory() {}
|
ZeroconfFactory() {}
|
||||||
virtual ~ZeroconfFactory() {}
|
virtual ~ZeroconfFactory() {}
|
||||||
|
|
||||||
virtual QString factoryId() { return "sipzeroconf"; }
|
virtual QString factoryId() const { return "sipzeroconf"; }
|
||||||
virtual QString prettyName() { return "Local Network"; }
|
virtual QString prettyName() const { return "Local Network"; }
|
||||||
virtual SipPlugin* createPlugin ( const QString& pluginId = QString() );
|
virtual SipPlugin* createPlugin ( const QString& pluginId = QString() );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user