Changeset - b15fcedf4544
[Not reviewed]
0 3 0
Vitaly Takmazov - 8 years ago 2017-12-01 10:44:10
vitalyster@gmail.com
communi: use QT_NO_KEYWORDS to prevent clashing with Boost
3 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
backends/libcommuni/CMakeLists.txt
Show inline comments
 
cmake_minimum_required(VERSION 2.6)
 
FILE(GLOB SRC *.cpp)
 
FILE(GLOB HEADERS *.h)
 
QT4_WRAP_CPP(SRC ${HEADERS} OPTIONS -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
 
add_definitions(-DQT_NO_KEYWORDS)
 
ADD_EXECUTABLE(spectrum2_libcommuni_backend ${SRC})
 

	
 
if (NOT WIN32)
 
	target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} Qt4::QtNetwork Qt4::QtCore transport pthread)
 
else ()
 
	target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} Qt4::QtNetwork Qt4::QtCore transport)
 
endif()
 
INSTALL(TARGETS spectrum2_libcommuni_backend RUNTIME DESTINATION bin)
 

	
backends/libcommuni/ircnetworkplugin.h
Show inline comments
 
@@ -36,42 +36,42 @@ class IRCNetworkPlugin : public QObject, public NetworkPlugin {
 
		IRCNetworkPlugin(Config *config, Swift::QtEventLoop *loop, const std::string &host, int port);
 

	
 
		void handleLoginRequest(const std::string &user, const std::string &legacyName, const std::string &password);
 

	
 
		void handleLogoutRequest(const std::string &user, const std::string &legacyName);
 

	
 
		void handleMessageSendRequest(const std::string &user, const std::string &legacyName, const std::string &message, const std::string &/*xhtml*/, const std::string &/*id*/);
 

	
 
		void handleJoinRoomRequest(const std::string &user, const std::string &room, const std::string &nickname, const std::string &password);
 

	
 
		void handleLeaveRoomRequest(const std::string &user, const std::string &room);
 

	
 
		void handleRoomSubjectChangedRequest(const std::string &user, const std::string &room, const std::string &message);
 

	
 
		void handleVCardRequest(const std::string &user, const std::string &legacyName, unsigned int id);
 

	
 
		void handleStatusChangeRequest(const std::string &user, int status, const std::string &statusMessage);
 

	
 
		void tryNextServer();
 

	
 
		Config *getConfig() {
 
			return m_config;
 
		}
 

	
 
	public slots:
 
	public Q_SLOTS:
 
		void readData();
 
		void sendData(const std::string &string);
 

	
 
	private:
 
		MyIrcSession *createSession(const std::string &user, const std::string &hostname, const std::string &nickname, const std::string &password, const std::string &suffix = "");
 
		std::string getSessionName(const std::string &user, const std::string &legacyName);
 
		std::string getTargetName(const std::string &legacyName);
 

	
 
	private:
 
		Config *m_config;
 
		QTcpSocket *m_socket;
 
		std::map<std::string, MyIrcSession *> m_sessions;
 
		std::vector<std::string> m_servers;
 
		int m_currentServer;
 
		std::string m_identify;
 
		bool m_firstPing;
 
};
include/Swiften/SwiftenCompat.h
Show inline comments
 
@@ -25,30 +25,29 @@
 
 *
 
 * Using these it is possible to declare shared pointers and signals like this:
 
 *
 
 * SWIFTEN_SIGNAL_NAMESPACE::signal signal;
 
 * SWIFTEN_SIGNAL_CONNECTION_NAMESPACE::connection &connection;
 
 * SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Type> ptr;
 
 *
 
 * These are guaranteed to be the same implementation as Swift uses internally,
 
 * thus can be used when passign/retrieveing data from/to swiften.
 
 *
 
 * This is due to Swift 4 moved from boost::shared_ptr to SWIFTEN_SHRPTR_NAMESPACE::shared_ptr
 
 * and from boost::signals to boost::signals2 .
 
 */
 

	
 
#if (SWIFTEN_VERSION >= 0x040000)
 
#define SWIFTEN_UNIQUE_PTR std::unique_ptr
 
#define SWIFTEN_SHRPTR_NAMESPACE std
 
#include <boost/signals2.hpp>
 
#define SWIFTEN_SIGNAL_NAMESPACE boost::signals2
 
#define SWIFTEN_SIGNAL_CONNECTION_NAMESPACE boost::signals2
 
#define SWIFT_HOSTADDRESS(x) *(Swift::HostAddress::fromString(x))
 
#else
 
#define SWIFTEN_UNIQUE_PTR std::auto_ptr
 
#define SWIFTEN_SHRPTR_NAMESPACE boost
 
#define BOOST_SIGNALS_NO_DEPRECATION_WARNING
 
#include <boost/signals.hpp>
 
#define SWIFTEN_SIGNAL_NAMESPACE boost
 
#define SWIFTEN_SIGNAL_CONNECTION_NAMESPACE boost::signals
 
#define SWIFT_HOSTADDRESS(x) Swift::HostAddress(x)
 
#endif
0 comments (0 inline, 0 general)