[-]
[+]
|
Changed |
sim-svn.spec
|
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/CMakeLists.txt
^
|
@@ -39,13 +39,14 @@
FIND_PACKAGE(LibXml2 REQUIRED)
FIND_PACKAGE(LibXslt REQUIRED)
FIND_PACKAGE(ZLIB REQUIRED)
+FIND_PACKAGE(OpenSSL REQUIRED)
IF(WIN32)
FIND_PACKAGE(LibIconv REQUIRED)
ENDIF(WIN32)
# optional packages
FIND_PACKAGE(ASPELL)
-FIND_PACKAGE(OpenSSL)
+
INCLUDE(FindX11)
IF(NOT WIN32)
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/Makefile.in
^
|
@@ -888,7 +888,7 @@
.NOEXPORT:
#>+ 2
-KDE_DIST=stamp-h.in config.h.cmake subdirs ALL_BUILD.vcproj Makefile.in configure.files sim.sln TODO.CMake config.h.in sim.vcproj configure.in altlinux.spec svn-ignore.sh aclocal.m4 ConfigureChecks.cmake jisp-resources.txt configure acinclude.m4 CMakeLists.txt Makefile.am
+KDE_DIST=config.h.cmake subdirs ALL_BUILD.vcproj Makefile.in configure.files sim.sln TODO.CMake config.h.in sim.vcproj configure.in altlinux.spec svn-ignore.sh aclocal.m4 ConfigureChecks.cmake jisp-resources.txt configure acinclude.m4 CMakeLists.txt Makefile.am
#>+ 2
docs-am:
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/admin/detect-autoconf.pl
^
|
@@ -32,6 +32,7 @@
'autoconf' => '2.5',
'automake' => '1.6',
);
+ my %ignore = map { $_ => 1 } qw(wrapper); # BSDism
# Allow user to use environment variable to override search.
return $ENV{uc $program} if $ENV{uc $program};
@@ -47,6 +48,8 @@
($version) = $file =~ /$prefix\/$program-?(.*)$/;
$version =~ s/-|\.//g;
+ next if $ignore{$version};
+
# Special case some programs to make sure it has a minimum version.
if (not $version and exists $minimumVersions{$program})
{
@@ -149,11 +152,7 @@
# Make sure we have all of the needed programs.
for $i (qw'autoconf autoheader autom4te automake aclocal')
{
- unless(${$i})
- {
- print "# Unable to find $i!!\n";
- exit 1;
- }
+ die "# $0: Unable to find $i!!\n" unless(${$i})
}
# Print results in eval-able form.
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/__homedir/homedir.cpp
^
|
@@ -151,14 +151,30 @@
char szPath[1024];
szPath[0] = 0;
QString defPath;
- (DWORD&)_SHGetSpecialFolderPathW = (DWORD)QLibrary::resolve("Shell32.dll","SHGetSpecialFolderPathW");
- (DWORD&)_SHGetSpecialFolderPathA = (DWORD)QLibrary::resolve("Shell32.dll","SHGetSpecialFolderPathA");
+
+ //Fixme:
+ //FOLDERID_RoamingAppData <<== this is used in Vista.. should be fixed
+ //otherwise the config is stored in "Downloads" per default :-/
+ //Windows 2008 Server tested, simply works...
+
+ (DWORD&)_SHGetSpecialFolderPathW = (DWORD)QLibrary::resolve("Shell32.dll","SHGetSpecialFolderPathW");
+ (DWORD&)_SHGetSpecialFolderPathA = (DWORD)QLibrary::resolve("Shell32.dll","SHGetSpecialFolderPathA");
+ //(DWORD&)_SHGetKnownFolderPath = (DWORD)QLibrary::resolve("Shell32.dll","SHGetKnownFolderPath"); //for Vista :-/
+
if (_SHGetSpecialFolderPathW && _SHGetSpecialFolderPathW(NULL, szPath, CSIDL_APPDATA, true)){
defPath = QString::fromUcs2((unsigned short*)szPath);
}else if (_SHGetSpecialFolderPathA && _SHGetSpecialFolderPathA(NULL, szPath, CSIDL_APPDATA, true)){
defPath = QFile::decodeName(szPath);
- }
- if (!defPath.isEmpty()){
+ }
+ //}else if (_SHGetKnownFolderPath && _SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0x00008000, NULL, szPath)){
+ // defPath = QFile::decodeName(szPath);
+
+ /*HRESULT SHGetKnownFolderPath( REFKNOWNFOLDERID rfid,
+ DWORD dwFlags,
+ HANDLE hToken,
+ PWSTR *ppszPath );*/
+
+ if (!defPath.isEmpty()){
if (!defPath.endsWith("\\"))
defPath += '\\';
defPath += "sim";
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/_core/autoreply.cpp
^
|
@@ -52,6 +52,9 @@
case STATUS_DND:
icon="SIM_dnd";
break;
+ case STATUS_OCCUPIED:
+ icon="SIM_occupied";
+ break;
case STATUS_FFC:
icon="SIM_ffc";
break;
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/_core/cfgdlg.cpp
^
|
@@ -268,6 +268,9 @@
case STATUS_DND:
icon="SIM_dnd";
break;
+ case STATUS_OCCUPIED:
+ icon="SIM_occupied";
+ break;
case STATUS_FFC:
icon="SIM_ffc";
break;
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/_core/core.cpp
^
|
@@ -369,8 +369,8 @@
static autoReply autoReplies[] =
{
{ STATUS_AWAY, I18N_NOOP(
- "I am currently away from ICQ.\n"
- "Please leave your message and I will get back to you as soon as I return!"
+ "I am currently away from the computer,\n"
+ "please leave your message and I will get back to you as soon as I return!"
) },
{ STATUS_NA, I18N_NOOP(
"I am out'a here.\n"
@@ -379,6 +379,9 @@
{ STATUS_DND, I18N_NOOP(
"Please do not disturb me now. Disturb me later."
) },
+ { STATUS_OCCUPIED, I18N_NOOP(
+ "I'm occupied at the moment. Please only urgent messages."
+ ) },
{ STATUS_FFC, I18N_NOOP(
"We'd love to hear what you have to say. Join our chat."
) },
@@ -1954,7 +1957,7 @@
dir = user_file(dir);
EventMessageAccept(msg, dir,
data->OverwriteFiles.toBool() ?
- Replace : Skip).process();
+ Replace : Ask).process();
return msg;
}
if (data->AcceptMode.toULong() == 2){
@@ -3797,11 +3800,36 @@
setContainers(containers);
if (m_main){
saveGeometry(m_main, data.geometry);
- saveToolbar(m_main->m_bar, data.toolBarState);
+ if (m_main->m_bar)
+ {
+ // Should update main toolbar pos only when toolbar is really exist...
+ saveToolbar(m_main->m_bar, data.toolBarState);
+ }
}
- QCString cfg = save_data(coreData, &data);
+
+// We should save profile and noshow values in profile-independent _core config, and
+// all other values in profile-dependent config.
+// FIXME: This is a nasty hack, profile management should be rewritten
+
+//Saving profile-independent config:
+static DataDef generalCoreDataDef[] =
+ {
+ { "Profile", DATA_STRING, 1, 0 },
+ { "NoShow", DATA_BOOL, 1, 0 }
+ };
+struct TGeneralCoreData
+{
+ SIM::Data Profile;
+ SIM::Data NoShow;
+} GeneralCoreData;
+
QString saveProfile = getProfile();
setProfile(QString::null);
+
+ GeneralCoreData.Profile.str() = saveProfile;
+ GeneralCoreData.NoShow.asBool() = getNoShow();
+
+ QCString cfg = save_data(generalCoreDataDef, &GeneralCoreData);
QString cfgName = user_file("plugins.conf");
QFile fCFG(cfgName + BACKUP_SUFFIX); // use backup file for this ...
if (!fCFG.open(IO_WriteOnly | IO_Truncate)){
@@ -3834,6 +3862,7 @@
}
}
+// Saving profile-dependent config:
setProfile(saveProfile);
cfgName = user_file(CLIENTS_CONF);
QFile f(cfgName + BACKUP_SUFFIX); // use backup file for this ...
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/_core/filetransfer.cpp
^
|
@@ -86,11 +86,16 @@
m_size = size;
m_name = m_name.replace('\\', '/');
+
FileTransfer *ft = m_dlg->m_msg->m_transfer;
int n = m_name.findRev('/');
+ QString fn("");
if (n >= 0){
QString path;
- QString p = m_name.left(n);
+ QString p(m_name.left(n));
+ fn = m_name.right(m_name.length()-n);
+ fn = fn.replace(QRegExp("/"), "");
+
while (!p.isEmpty()){
if (!path.isEmpty())
path += '/';
@@ -102,7 +107,7 @@
return;
}
path += pp;
- QDir dd(ft->dir() + '/' + path);
+ QDir dd(ft->dir() /* + '/' + path */);
if (!dd.exists()){
QDir d(ft->dir());
if (!d.mkdir(path)){
@@ -119,8 +124,14 @@
ft->startReceive(0);
return;
}
- QString shortName = m_name;
- m_name = ft->dir() + m_name;
+
+ QString shortName = m_name;
+ //m_name = ft->dir() + m_name; Quickfix, noragen
+ if (fn.isEmpty())
+ fn=m_name;
+
+ m_name = ft->dir() + fn;
+
if (ft->m_file)
delete ft->m_file;
m_dlg->process();
@@ -137,13 +148,13 @@
}
break;
case Resume:
- if (ft->m_file->open(IO_WriteOnly)){
+ if (ft->m_file->open(IO_WriteOnly | IO_Append)){
resume();
return;
}
break;
default:
- if (ft->m_file->open(IO_WriteOnly)){
+ if (ft->m_file->open(IO_WriteOnly | IO_Append)){
QStringList buttons;
QString forAll;
if (ft->files())
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/_core/status.cpp
^
|
@@ -162,6 +162,9 @@
case STATUS_DND:
icon="SIM_dnd";
break;
+ case STATUS_OCCUPIED:
+ icon="SIM_occupied";
+ break;
case STATUS_FFC:
icon="SIM_ffc";
break;
@@ -263,6 +266,9 @@
case STATUS_DND:
c.icon="SIM_dnd";
break;
+ case STATUS_OCCUPIED:
+ c.icon="SIM_occupied";
+ break;
case STATUS_FFC:
c.icon="SIM_ffc";
break;
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/_core/usercfg.cpp
^
|
@@ -231,6 +231,9 @@
case STATUS_DND:
icon="SIM_dnd";
break;
+ case STATUS_OCCUPIED:
+ icon="SIM_occupied";
+ break;
case STATUS_FFC:
icon="SIM_ffc";
break;
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/_core/userlist.cpp
^
|
@@ -1061,7 +1061,10 @@
}else{
switch (item->status()){
case STATUS_ONLINE:
+ p->setPen(CorePlugin::m_plugin->getColorOnline());
+ break;
case STATUS_FFC:
+ p->setPen(CorePlugin::m_plugin->getColorOnline());
break;
case STATUS_AWAY:
p->setPen(CorePlugin::m_plugin->getColorAway());
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/_core/userview.cpp
^
|
@@ -301,6 +301,8 @@
}else{
switch (item->status()){
case STATUS_ONLINE:
+ p->setPen(CorePlugin::m_plugin->getColorOnline());
+ break;
case STATUS_FFC:
p->setPen(CorePlugin::m_plugin->getColorOnline());
break;
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/about/Makefile.am
^
|
@@ -5,7 +5,8 @@
aboutdlg.cpp \
aboutdlgbase.ui
-INCLUDES=-I$(srcdir)/../../sim $(all_includes)
+# set the include path for X, qt and KDE
+INCLUDES=$(LTDLINCL) -I$(srcdir)/../../sim -I. -I../_core $(all_includes)
about_la_METASOURCES = AUTO
about_la_LIBADD = ../../sim/libsim.la $(LIBUI) $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(EXTRA_LIBS)
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/about/Makefile.in
^
|
@@ -405,7 +405,9 @@
aboutdlg.cpp \
aboutdlgbase.cpp
-INCLUDES = -I$(srcdir)/../../sim $(all_includes)
+
+# set the include path for X, qt and KDE
+INCLUDES = $(LTDLINCL) -I$(srcdir)/../../sim -I. -I../_core $(all_includes)
#>- about_la_METASOURCES = AUTO
about_la_LIBADD = ../../sim/libsim.la $(LIBUI) $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(EXTRA_LIBS)
#>- about_la_LDFLAGS = -module -no-undefined -avoid-version -L../../sim/.libs $(QT_LDFLAGS) $(KDE_RPATH) $(all_libraries)
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/about/aboutdlg.cpp
^
|
@@ -55,7 +55,7 @@
edtVersion->setPalette(p);
txtAbout->setText((QString("<center><br>%1<br><br>%2<br><br>") +
"<a href=\"%3\">%4</a><br><br>" +
- i18n("Bug report") + ": <a href=\"mailto:%5\">%6</a><br>" +
+ i18n("Bug report") + ": <a href=\"%5\">%6</a><br>" +
i18n("Note: This is an english mailing list") +
"</center>")
.arg(quote(aboutData->shortDescription()))
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/autoaway/Makefile.am
^
|
@@ -1,17 +1,12 @@
-if ENABLE_AUTOAWAY
sim_plugin_LTLIBRARIES = autoaway.la
-endif
-autoaway_la_SOURCES = \
- autoawaycfgbase.ui \
- autoawaycfg.cpp \
- autoaway.cpp
+autoaway_la_SOURCES = autoaway.cpp autoawaycfg.cpp autoawaycfgbase.ui idleui.cpp
INCLUDES=-I$(srcdir)/../../sim -I../_core -I$(srcdir)/../_core $(all_includes)
autoaway_la_METASOURCES = AUTO
-autoaway_la_LIBADD = ../../sim/libsim.la $(LIB_QT) $(LIB_KDECORE) $(EXTRA_LIBS) $(XSS_LIBS)
-autoaway_la_LDFLAGS = -module -no-undefined -avoid-version -L../../sim/.libs $(QT_LDFLAGS) $(KDE_RPATH) $(all_libraries)
+autoaway_la_LIBADD = ../../sim/libsim.la $(LIBUI) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KFILE) $(LIB_QT)
+autoaway_la_LDFLAGS = -module -no-undefined -avoid-version -L../../sim/.libs $(QT_LDFLAGS) $(KDE_RPATH) $(all_libraries) -lXss
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/autoaway/Makefile.in
^
|
@@ -61,14 +61,13 @@
autoaway_la_DEPENDENCIES = ../../sim/libsim.la $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
-am_autoaway_la_OBJECTS = autoawaycfg.lo autoaway.lo
+am_autoaway_la_OBJECTS = autoaway.lo autoawaycfg.lo idleui.lo
#>- autoaway_la_OBJECTS = $(am_autoaway_la_OBJECTS)
#>+ 4
autoaway_la_final_OBJECTS = autoaway_la.all_cpp.lo
-autoaway_la_nofinal_OBJECTS = autoawaycfg.lo autoaway.lo autoawaycfgbase.lo
+autoaway_la_nofinal_OBJECTS = autoaway.lo autoawaycfg.lo idleui.lo autoawaycfgbase.lo
@KDE_USE_FINAL_FALSE@autoaway_la_OBJECTS = $(autoaway_la_nofinal_OBJECTS)
@KDE_USE_FINAL_TRUE@autoaway_la_OBJECTS = $(autoaway_la_final_OBJECTS)
-@ENABLE_AUTOAWAY_TRUE@am_autoaway_la_rpath = -rpath $(sim_plugindir)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
am__depfiles_maybe = depfiles
@@ -395,23 +394,16 @@
xdg_appsdir = @xdg_appsdir@
xdg_directorydir = @xdg_directorydir@
xdg_menudir = @xdg_menudir@
-@ENABLE_AUTOAWAY_TRUE@sim_plugin_LTLIBRARIES = autoaway.la
-#>- autoaway_la_SOURCES = \
-#>- autoawaycfgbase.ui \
-#>- autoawaycfg.cpp \
-#>- autoaway.cpp
-#>+ 4
-autoaway_la_SOURCES=\
- \
- autoawaycfg.cpp \
- autoaway.cpp autoawaycfgbase.cpp
-
+sim_plugin_LTLIBRARIES = autoaway.la
+#>- autoaway_la_SOURCES = autoaway.cpp autoawaycfg.cpp autoawaycfgbase.ui idleui.cpp
+#>+ 1
+autoaway_la_SOURCES=autoaway.cpp autoawaycfg.cpp idleui.cpp autoawaycfgbase.cpp
INCLUDES = -I$(srcdir)/../../sim -I../_core -I$(srcdir)/../_core $(all_includes)
#>- autoaway_la_METASOURCES = AUTO
-autoaway_la_LIBADD = ../../sim/libsim.la $(LIB_QT) $(LIB_KDECORE) $(EXTRA_LIBS) $(XSS_LIBS)
-#>- autoaway_la_LDFLAGS = -module -no-undefined -avoid-version -L../../sim/.libs $(QT_LDFLAGS) $(KDE_RPATH) $(all_libraries)
+autoaway_la_LIBADD = ../../sim/libsim.la $(LIBUI) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KFILE) $(LIB_QT)
+#>- autoaway_la_LDFLAGS = -module -no-undefined -avoid-version -L../../sim/.libs $(QT_LDFLAGS) $(KDE_RPATH) $(all_libraries) -lXss
#>+ 1
-autoaway_la_LDFLAGS = -module -no-undefined $(KDE_NO_UNDEFINED) -avoid-version -L../../sim/.libs $(QT_LDFLAGS) $(KDE_RPATH) $(all_libraries)
+autoaway_la_LDFLAGS = -module -no-undefined $(KDE_NO_UNDEFINED) -avoid-version -L../../sim/.libs $(QT_LDFLAGS) $(KDE_RPATH) $(all_libraries) -lXss
#>- all: all-am
#>+ 1
all: docs-am all-am
@@ -491,7 +483,7 @@
#>+ 2
@KDE_USE_CLOSURE_TRUE@autoaway.la: autoaway.la.closure $(autoaway_la_OBJECTS) $(autoaway_la_DEPENDENCIES)
@KDE_USE_CLOSURE_FALSE@autoaway.la: $(autoaway_la_OBJECTS) $(autoaway_la_DEPENDENCIES)
- $(CXXLINK) $(am_autoaway_la_rpath) $(autoaway_la_LDFLAGS) $(autoaway_la_OBJECTS) $(autoaway_la_LIBADD) $(LIBS)
+ $(CXXLINK) -rpath $(sim_plugindir) $(autoaway_la_LDFLAGS) $(autoaway_la_OBJECTS) $(autoaway_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -501,6 +493,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/autoaway.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/autoawaycfg.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idleui.Plo@am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@@ -740,7 +733,7 @@
-rm -f autoawaycfg.moc autoaway.moc
#>+ 2
-KDE_DIST=idleui.def idleui.h autoaway.rc idleui.vcproj idleui.cpp autoaway.h Makefile.in autoaway.vcproj autoawaycfg.h configure.in.in CMakeLists.txt autoawaycfgbase.ui Makefile.am
+KDE_DIST=idleui.def idleui.h autoaway.rc idleui.vcproj autoaway.h Makefile.in autoaway.vcproj autoawaycfg.h configure.in.in CMakeLists.txt autoawaycfgbase.ui Makefile.am
#>+ 4
clean-ui:
@@ -793,11 +786,11 @@
#>+ 11
-autoaway_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/autoawaycfg.cpp $(srcdir)/autoaway.cpp autoawaycfgbase.cpp autoawaycfg.moc autoawaycfgbase.moc autoaway.moc
+autoaway_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/autoaway.cpp $(srcdir)/autoawaycfg.cpp $(srcdir)/idleui.cpp autoawaycfgbase.cpp autoawaycfg.moc autoawaycfgbase.moc autoaway.moc
@echo 'creating autoaway_la.all_cpp.cpp ...'; \
rm -f autoaway_la.all_cpp.files autoaway_la.all_cpp.final; \
echo "#define KDE_USE_FINAL 1" >> autoaway_la.all_cpp.final; \
- for file in autoawaycfg.cpp autoaway.cpp autoawaycfgbase.cpp ; do \
+ for file in autoaway.cpp autoawaycfg.cpp idleui.cpp autoawaycfgbase.cpp ; do \
echo "#include \"$$file\"" >> autoaway_la.all_cpp.files; \
test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> autoaway_la.all_cpp.final; \
done; \
@@ -828,13 +821,14 @@
kde-rpo-clean:
-rm -f *.rpo
-#>+ 9
+#>+ 10
nmcheck:
$(srcdir)/autoaway.cpp: autoawaycfgbase.h
nmcheck-am: nmcheck
$(srcdir)/autoawaycfg.cpp: autoawaycfgbase.h
autoaway.o: autoaway.moc
autoaway.lo: autoaway.moc
+$(srcdir)/idleui.cpp: autoawaycfgbase.h
autoawaycfg.o: autoawaycfg.moc
autoawaycfg.lo: autoawaycfg.moc
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/autoaway/autoaway.cpp
^
|
@@ -160,14 +160,15 @@
static DataDef autoAwayData[] =
{
- { "AwayTime", DATA_ULONG, 1, DATA(3) },
- { "EnableAway", DATA_BOOL, 1, DATA(1) },
- { "NATime", DATA_ULONG, 1, DATA(10) },
- { "EnableNA", DATA_BOOL, 1, DATA(1) },
- { "OffTime", DATA_ULONG, 1, DATA(10) },
- { "EnableOff", DATA_BOOL, 1, 0 },
- { "DisableAlert", DATA_BOOL, 1, DATA(1) },
- { NULL, DATA_UNKNOWN, 0, 0 }
+ { "AwayTime", DATA_ULONG, 1, DATA(3) },
+ { "EnableAway", DATA_BOOL, 1, DATA(1) },
+ { "NATime", DATA_ULONG, 1, DATA(10)},
+ { "EnableNA", DATA_BOOL, 1, DATA(1) },
+ { "OffTime", DATA_ULONG, 1, DATA(10)},
+ { "EnableOff", DATA_BOOL, 1, 0 },
+ { "DisableAlert", DATA_BOOL, 1, DATA(1) },
+ { "RealManualStatus", DATA_ULONG, 1, DATA(STATUS_UNKNOWN) },
+ { NULL, DATA_UNKNOWN, 0, 0 }
};
AutoAwayPlugin::AutoAwayPlugin(unsigned base, Buffer *config)
@@ -253,7 +254,14 @@
void AutoAwayPlugin::timeout()
{
unsigned long newStatus = core->getManualStatus();
+ unsigned long oldStatus =getRealManualStatus();
unsigned idle_time = getIdleTime() / 60;
+ if (oldStatus != STATUS_UNKNOWN &&
+ !bAway && !bNA && !bOff){
+ // If fake ManualStatus were saved in config by chace, we should replace it by real value...
+ newStatus = oldStatus;
+ oldStatus = STATUS_UNKNOWN;
+ }
if ((bAway && (idle_time < getAwayTime())) ||
(bNA && (idle_time < getNATime())) ||
(bOff && (idle_time < getOffTime()))){
@@ -261,6 +269,7 @@
bNA = false;
bOff = false;
newStatus = oldStatus;
+ oldStatus = STATUS_UNKNOWN;
}else if (!bAway && !bNA && !bOff && getEnableAway() && (idle_time >= getAwayTime())){
unsigned long status = core->getManualStatus();
if ((status == STATUS_AWAY) || (status == STATUS_NA) || (status == STATUS_OFFLINE))
@@ -297,6 +306,7 @@
return;
core->data.StatusTime.asULong() = time(NULL);
core->data.ManualStatus.asULong() = newStatus;
+ setRealManualStatus(oldStatus);
EventClientStatus().process();
}
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/autoaway/autoaway.h
^
|
@@ -36,6 +36,7 @@
SIM::Data OffTime;
SIM::Data EnableOff;
SIM::Data DisableAlert;
+ SIM::Data RealManualStatus;
};
class AutoAwayPlugin : public QObject, public SIM::Plugin, public SIM::EventReceiver
@@ -51,6 +52,7 @@
PROP_ULONG(OffTime);
PROP_BOOL(EnableOff);
PROP_BOOL(DisableAlert);
+ PROP_ULONG(RealManualStatus);
protected slots:
void timeout();
protected:
@@ -62,7 +64,6 @@
bool bNA;
bool bOff;
CorePlugin *core;
- unsigned long oldStatus;
QTimer *m_timer;
AutoAwayData data;
};
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/autoaway/idleui.cpp
^
|
@@ -6,7 +6,7 @@
//
// See IdleUI.h
//
-
+#ifdef WIN32
#include<windows.h>
#include<winuser.h>
#include<assert.h>
@@ -173,3 +173,5 @@
}
return TRUE;
}
+#endif
+
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/aimservices.cpp
^
|
@@ -49,6 +49,10 @@
{
log(L_DEBUG, "%s: connect to %s:%d ", serviceSocketName(), addr, port);
m_cookie = cookie;
+ if(m_socket != NULL){
+ m_socket->close();
+ delete m_socket;
+ }
m_socket = new ICQClientSocket(this);
m_socket->connect(addr, port, m_client);
}
@@ -167,7 +171,7 @@
void SearchSocket::addTlv(unsigned short n, const QString &s, bool bLatin)
{
- QCString str;
+ QString str;
if (bLatin){
str = s.latin1();
}else{
@@ -418,3 +422,4 @@
return s->add(info);
}
+
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/icqbuffer.cpp
^
|
@@ -1,492 +1,530 @@
-/***************************************************************************
- msnfiltetransfer.cpp - description
- -------------------
- begin : Fri Jan 05 2007
- copyright : (C) 2007 Christian Ehrlicher
- email : ch.ehrlicher@gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * 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 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
-#ifdef WIN32
-#include <winsock.h>
-#else
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <arpa/inet.h>
-#endif
-
-#include "simapi.h"
-#include "log.h"
-
-#include "icqbuffer.h"
-
-using namespace SIM;
-
-// FIXME: move into own file
-#ifdef WORDS_BIGENDIAN
-# define SWAP_S(s) s = ((s&0xFF)<<8) + ((s&0xFF00)>>8);
-# define SWAP_L(s) s = ((s&0xFF)<<24) + ((s&0xFF00)<<8) + ((s&0xFF0000)>>8) + ((s&0xFF000000)>>24);
-#else
-# define SWAP_S(s)
-# define SWAP_L(s)
-#endif
-// Tlv
-Tlv::Tlv(unsigned short num, unsigned short size, const char *data)
- : m_nNum(num), m_nSize(size)
-{
- m_data.resize(m_nSize + 1);
- memcpy(m_data.data(), data, m_nSize);
- m_data[(int)m_nSize] = 0;
-}
-
-Tlv::operator uint16_t () const
-{
- return (m_nSize >= 2) ? htons(*((uint16_t*)m_data.data())) : 0;
-}
-
-Tlv::operator uint32_t () const
-{
- return (m_nSize >= 4) ? htonl(*((uint32_t*)m_data.data())) : 0;
-}
-
-// TlvList
-TlvList::TlvList()
-{}
-
-TlvList::TlvList(ICQBuffer &b, unsigned nTlvs)
-{
- for (unsigned n = 0; (b.readPos() < b.size()) && (n < nTlvs); n++){
- unsigned short num, size;
- b >> num >> size;
- if (b.readPos() + size > b.size())
- break;
- append(new Tlv(num, size, b.data(b.readPos())));
- b.incReadPos(size);
- }
-}
-
-TlvList::~TlvList()
-{
- for(uint i = 0; i < count(); i++)
- delete *at((int)i);
-}
-
-Tlv *TlvList::operator()(unsigned short num, int skip)
-{
- for(uint i = 0; i < count(); i++) {
- if ((*at(i))->Num() == num) {
- if(skip == 0)
- return *at(i);
- --skip;
- }
- }
- return NULL;
-}
-
-ICQBuffer::ICQBuffer(unsigned size)
- : Buffer(size)
-{}
-
-ICQBuffer::ICQBuffer(const QByteArray &ba)
- : Buffer(ba)
-{}
-
-ICQBuffer::ICQBuffer(Tlv &tlv)
- : Buffer(tlv.Size())
-{
- pack((char*)tlv, tlv.Size());
-}
-
-
-ICQBuffer::~ICQBuffer()
-{}
-
-void ICQBuffer::tlv(unsigned short n, const char *data, unsigned short len)
-{
- *this << n << len;
- pack(data, len);
-}
-
-void ICQBuffer::tlvLE(unsigned short n, const char *data, unsigned short len)
-{
- pack(n);
- pack(len);
- pack(data, len);
-}
-
-void ICQBuffer::tlv(unsigned short n, const char *data)
-{
- if (data == NULL)
- data = "";
- tlv(n, data, (unsigned short)strlen(data));
-}
-
-void ICQBuffer::tlvLE(unsigned short n, const char *data)
-{
- if (data == NULL)
- data = "";
- unsigned short len = strlen(data) + 1;
- pack(n);
- pack((unsigned short)(len + 2));
- pack(len);
- pack(data, len);
-}
-
-void ICQBuffer::tlv(unsigned short n, unsigned short c)
-{
- c = htons(c);
- tlv(n, (char*)&c, 2);
-}
-
-void ICQBuffer::tlvLE(unsigned short n, unsigned short c)
-{
- pack(n);
- pack((unsigned short)2);
- pack(c);
-}
-
-void ICQBuffer::tlv(unsigned short n, unsigned long c)
-{
- /* XXX:
- * WARNING! BUG HERE. sizeof(long) is not 4 on 64bit platform */
- c = htonl(c);
- tlv(n, (char*)&c, 4);
-}
-
-void ICQBuffer::tlvLE(unsigned short n, unsigned long c)
-{
- /* XXX:
- * WARNING! BUG HERE. sizeof(long) is not 4 on 64bit platform */
- pack(n);
- pack((unsigned short)4);
- pack(c);
-}
-
-ICQBuffer &ICQBuffer::operator << (const TlvList &tlvList)
-{
- unsigned size = 0;
- for (uint i = 0; i < tlvList.count(); i++)
- size += tlvList[(int)i]->Size() + 4;
- *this << (unsigned short)size;
- for (uint i = 0; i < tlvList.count(); i++) {
- Tlv *tlv = tlvList[(int)i];
- *this << tlv->Num() << (int)tlv->Size();
- pack(*tlv, tlv->Size());
- }
- return *this;
-}
-
-ICQBuffer &ICQBuffer::operator << (const QString &s)
-{
- QCString utf8 = s.utf8();
- unsigned short size = (unsigned short)(utf8.length() + 1);
- *this << (unsigned short)htons(size);
- pack(utf8, size);
- return *this;
-}
-
-ICQBuffer &ICQBuffer::operator << (const QCString &s)
-{
- if(!s.length())
- return *this;
- unsigned short size = (unsigned short)(s.length() + 1);
- *this << (unsigned short)htons(size);
- pack(s, size);
- return *this;
-}
-
-ICQBuffer &ICQBuffer::operator << (const QByteArray &s)
-{
- if(!s.size())
- return *this;
- unsigned short size = (unsigned short)(s.size());
- *this << (unsigned short)htons(size);
- pack(s, size);
- return *this;
-}
-
-ICQBuffer &ICQBuffer::operator << (const Buffer &b)
-{
- unsigned short size = (unsigned short)(b.size() - b.readPos());
- *this << (unsigned short)htons(size);
- pack(b.data(b.readPos()), size);
- return *this;
-}
-
-ICQBuffer &ICQBuffer::operator << (char c)
-{
- pack(&c, 1);
- return *this;
-}
-
-ICQBuffer &ICQBuffer::operator << (const char *str)
-{
- if(!str)
- return *this;
- pack(str, strlen(str));
- return *this;
-}
-
-ICQBuffer &ICQBuffer::operator << (unsigned short c)
-{
- c = htons(c);
- pack((char*)&c, 2);
- return *this;
-}
-
-ICQBuffer &ICQBuffer::operator << (unsigned long c)
-{
- /* XXX:
- * WARNING! BUG HERE. sizeof(long) is not 4 on 64bit platform */
- c = htonl(c);
- pack((char*)&c, 4);
- return *this;
-}
-
-ICQBuffer &ICQBuffer::operator << (bool b)
-{
- char c = b ? (char)1 : (char)0;
- pack(&c, 1);
- return *this;
-}
-
-ICQBuffer &ICQBuffer::operator >> (QCString &str)
-{
- unsigned short s;
- str = "";
-
- *this >> s;
- s = htons(s);
- if (s == 0)
- return *this;
- if (s > size() - m_posRead)
- s = (unsigned short)(size() - m_posRead);
- unpack(str, s);
- return *this;
-}
-
-ICQBuffer &ICQBuffer::operator >> (char &c)
-{
- if (unpack(&c, 1) != 1)
- c = 0;
- return *this;
-}
-
-ICQBuffer &ICQBuffer::operator >> (unsigned short &c)
-{
- if (unpack((char*)&c, 2) != 2)
- c = 0;
- c = ntohs(c);
- return *this;
-}
-
-ICQBuffer &ICQBuffer::operator >> (unsigned long &c)
-{
- /* XXX:
- * WARNING! BUG HERE. sizeof(long) is not 4 on 64bit platform */
- if (unpack((char*)&c, 4) != 4)
- c = 0;
- c = ntohl(c);
- return *this;
-}
-
-ICQBuffer &ICQBuffer::operator >> (int &c)
-{
- if (unpack((char*)&c, 4) != 4)
- c = 0;
- c = ntohl(c);
- return *this;
-}
-
-void ICQBuffer::packScreen(const QString &screen)
-{
- char len = screen.utf8().length();
- pack(&len, 1);
- pack(screen.utf8(), len);
-}
-
-void ICQBuffer::packStr32(const QCString &s)
-{
- unsigned long size = s.length();
- pack(size);
- pack(s, size);
-}
-
-void ICQBuffer::pack32(const Buffer &b)
-{
- /* XXX:
- * WARNING! BUG HERE. sizeof(long) is not 4 on 64bit platform */
- unsigned long size = b.size() - b.readPos();
- *this << (unsigned long)htonl(size);
- pack(b.data(b.readPos()), size);
-}
-
-void ICQBuffer::pack(const QCString &s)
-{
- unsigned short size = (unsigned short)(s.size());
- *this << size;
- pack(s, size);
-}
-
-void ICQBuffer::pack(const QString &s)
-{
- QCString cstr = s.utf8();
- unsigned short size = (unsigned short)(s.length());
- *this << size;
- pack(cstr, size);
-}
-
-void ICQBuffer::pack(unsigned short s)
-{
- SWAP_S(s);
- pack((char*)&s, 2);
-}
-
-void ICQBuffer::pack(unsigned long s)
-{
- /* XXX:
- * WARNING! BUG HERE. sizeof(long) is not 4 on 64bit platform */
- unsigned int i = s;
- SWAP_L(i);
- pack((char*)&i, 4);
-}
-
-bool ICQBuffer::unpackStr(QString &str)
-{
- unsigned short s;
- str = QString::null;
- *this >> s;
- if (s == 0)
- return false;
- if (s > size() - m_posRead)
- s = (unsigned short)(size() - m_posRead);
- unpack(str, s);
- return true;
-}
-
-bool ICQBuffer::unpackStr(QCString &str)
-{
- unsigned short s;
- str = "";
- *this >> s;
- if (s == 0)
- return false;
- if (s > size() - m_posRead)
- s = (unsigned short)(size() - m_posRead);
- unpack(str, s);
- return true;
-}
-
-bool ICQBuffer::unpackStr32(QCString &str)
-{
- unsigned long s;
- *this >> s;
- s = ntohl(s);
- str = "";
- if (s == 0)
- return false;
- if (s > size() - m_posRead)
- s = size() - m_posRead;
- unpack(str, s);
- return true;
-}
-
-bool ICQBuffer::unpackStr32(QByteArray &str)
-{
- unsigned long s;
- *this >> s;
- s = ntohl(s);
- str = QByteArray();
- if (s == 0)
- return false;
- if (s > size() - m_posRead)
- s = size() - m_posRead;
- unpack(str, s);
- return true;
-}
-
-QString ICQBuffer::unpackScreen()
-{
- char len;
- QString res;
-
- *this >> len;
- /* 13 isn't right, AIM allows 16. But when we get a longer
- name, we *must* unpack them if we won't lose the TLVs
- behind the Screenname ... */
- if (len > 16)
- log(L_DEBUG,"Too long Screenname! Length: %d",len);
- unpack(res, len);
- return res;
-}
-
-unsigned ICQBuffer::unpack(char *d, unsigned s)
-{
- unsigned readn = size() - m_posRead;
- if (s < readn)
- readn = s;
- memcpy(d, data() + m_posRead, readn);
- m_posRead += readn;
- return readn;
-}
-
-unsigned ICQBuffer::unpack(QString &d, unsigned s)
-{
- unsigned readn = size() - m_posRead;
- if (s < readn)
- readn = s;
- d = QString::fromUtf8(data() + m_posRead, readn);
- m_posRead += readn;
- return readn;
-}
-
-unsigned ICQBuffer::unpack(QCString &d, unsigned s)
-{
- unsigned readn = size() - m_posRead;
- if (s < readn)
- readn = s;
- d = QCString(data() + m_posRead, readn + 1);
- m_posRead += readn;
- return readn;
-}
-
-unsigned ICQBuffer::unpack(QByteArray &d, unsigned s)
-{
- unsigned readn = size() - m_posRead;
- if (s < readn)
- readn = s;
- d = QByteArray::duplicate(data() + m_posRead, readn);
- unsigned size = d.size();
- d.resize(size + 1);
- d.data()[size] = '\0';
- m_posRead += readn;
- return readn;
-}
-
-void ICQBuffer::unpack(unsigned short &c)
-{
- if (unpack((char*)&c, 2) != 2)
- c = 0;
- SWAP_S(c);
-}
-
-void ICQBuffer::unpack(unsigned long &c)
-{
- // FIXME: This needs to be rewritten for 64-bit machines.
- // Kludge for now.
- unsigned int i;
- if (unpack((char*)&i, 4) != 4)
- i = 0;
- SWAP_L(i);
- c = i;
-}
+/***************************************************************************
+ msnfiltetransfer.cpp - description
+ -------------------
+ begin : Fri Jan 05 2007
+ copyright : (C) 2007 Christian Ehrlicher
+ email : ch.ehrlicher@gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifdef WIN32
+#include <winsock.h>
+#else
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <arpa/inet.h>
+#endif
+
+#include "simapi.h"
+#include "log.h"
+
+#include "icqbuffer.h"
+
+using namespace SIM;
+
+// FIXME: move into own file
+#ifdef WORDS_BIGENDIAN
+# define SWAP_S(s) s = ((s&0xFF)<<8) + ((s&0xFF00)>>8);
+# define SWAP_L(s) s = ((s&0xFF)<<24) + ((s&0xFF00)<<8) + ((s&0xFF0000)>>8) + ((s&0xFF000000)>>24);
+#else
+# define SWAP_S(s)
+# define SWAP_L(s)
+#endif
+// Tlv
+Tlv::Tlv(unsigned short num, unsigned short size, const char *data)
+ : m_nNum(num), m_nSize(size)
+{
+ m_data.resize(m_nSize + 1);
+ memcpy(m_data.data(), data, m_nSize);
+ m_data[(int)m_nSize] = 0;
+}
+
+Tlv::operator uint16_t () const
+{
+ return (m_nSize >= 2) ? htons(*((uint16_t*)m_data.data())) : 0;
+}
+
+Tlv::operator uint32_t () const
+{
+ return (m_nSize >= 4) ? htonl(*((uint32_t*)m_data.data())) : 0;
+}
+
+// TlvList
+TlvList::TlvList()
+{}
+
+TlvList::TlvList(ICQBuffer &b, unsigned nTlvs)
+{
+ for (unsigned n = 0; (b.readPos() < b.size()) && (n < nTlvs); n++){
+ unsigned short num, size;
+ b >> num >> size;
+ if (b.readPos() + size > b.size())
+ break;
+ append(new Tlv(num, size, b.data(b.readPos())));
+ b.incReadPos(size);
+ }
+}
+
+TlvList::~TlvList()
+{
+ for(uint i = 0; i < count(); i++)
+ delete *at((int)i);
+}
+
+Tlv *TlvList::operator()(unsigned short num, int skip)
+{
+ for(uint i = 0; i < count(); i++) {
+ if ((*at(i))->Num() == num) {
+ if(skip == 0)
+ return *at(i);
+ --skip;
+ }
+ }
+ return NULL;
+}
+
+ICQBuffer::ICQBuffer(unsigned size)
+ : Buffer(size)
+{}
+
+ICQBuffer::ICQBuffer(const QByteArray &ba)
+ : Buffer(ba)
+{}
+
+ICQBuffer::ICQBuffer(Tlv &tlv)
+ : Buffer(tlv.Size())
+{
+ pack((char*)tlv, tlv.Size());
+}
+
+
+ICQBuffer::~ICQBuffer()
+{}
+
+void ICQBuffer::tlv(unsigned short n, const char *data, unsigned short len)
+{
+ *this << n << len;
+ pack(data, len);
+}
+
+void ICQBuffer::tlvLE(unsigned short n, const char *data, unsigned short len)
+{
+ pack(n);
+ pack(len);
+ pack(data, len);
+}
+
+void ICQBuffer::tlv(unsigned short n, const char *data)
+{
+ if (data == NULL)
+ data = "";
+ tlv(n, data, (unsigned short)strlen(data));
+}
+
+void ICQBuffer::tlvLE(unsigned short n, const char *data)
+{
+ if (data == NULL)
+ data = "";
+ unsigned short len = strlen(data) + 1;
+ pack(n);
+ pack((unsigned short)(len + 2));
+ pack(len);
+ pack(data, len);
+}
+
+void ICQBuffer::tlv(unsigned short n, unsigned short c)
+{
+ c = htons(c);
+ tlv(n, (char*)&c, 2);
+}
+
+void ICQBuffer::tlvLE(unsigned short n, unsigned short c)
+{
+ pack(n);
+ pack((unsigned short)2);
+ pack(c);
+}
+
+void ICQBuffer::tlv(unsigned short n, unsigned long c)
+{
+ /* XXX:
+ * WARNING! BUG HERE. sizeof(long) is not 4 on 64bit platform */
+ c = htonl(c);
+ tlv(n, (char*)&c, 4);
+}
+
+void ICQBuffer::tlvLE(unsigned short n, unsigned long c)
+{
+ /* XXX:
+ * WARNING! BUG HERE. sizeof(long) is not 4 on 64bit platform */
+ pack(n);
+ pack((unsigned short)4);
+ pack(c);
+}
+
+ICQBuffer &ICQBuffer::operator << (const TlvList &tlvList)
+{
+ unsigned size = 0;
+ for (uint i = 0; i < tlvList.count(); i++)
+ size += tlvList[(int)i]->Size() + 4;
+ *this << (unsigned short)size;
+ for (uint i = 0; i < tlvList.count(); i++) {
+ Tlv *tlv = tlvList[(int)i];
+ *this << tlv->Num() << (int)tlv->Size();
+ pack(*tlv, tlv->Size());
+ }
+ return *this;
+}
+
+ICQBuffer &ICQBuffer::operator << (const QString &s)
+{
+ QString utf8 = s.utf8();
+ unsigned short size = (unsigned short)(utf8.length() + 1);
+ *this << (unsigned short)htons(size);
+ pack(utf8, size);
+ return *this;
+}
+/*
+ICQBuffer &ICQBuffer::operator << (const QString &s)
+{
+ if(!s.length())
+ return *this;
+ unsigned short size = (unsigned short)(s.length() + 1);
+ *this << (unsigned short)htons(size);
+ pack(s, size);
+ return *this;
+}
+*/
+ICQBuffer &ICQBuffer::operator << (const QByteArray &s)
+{
+ if(!s.size())
+ return *this;
+ unsigned short size = (unsigned short)(s.size());
+ *this << (unsigned short)htons(size);
+ pack(s, size);
+ return *this;
+}
+
+ICQBuffer &ICQBuffer::operator << (const Buffer &b)
+{
+ unsigned short size = (unsigned short)(b.size() - b.readPos());
+ *this << (unsigned short)htons(size);
+ pack(b.data(b.readPos()), size);
+ return *this;
+}
+
+ICQBuffer &ICQBuffer::operator << (char c)
+{
+ pack(&c, 1);
+ return *this;
+}
+
+ICQBuffer &ICQBuffer::operator << (const char *str)
+{
+ if(!str)
+ return *this;
+ pack(str, strlen(str));
+ return *this;
+}
+
+ICQBuffer &ICQBuffer::operator << (unsigned short c)
+{
+ c = htons(c);
+ pack((char*)&c, 2);
+ return *this;
+}
+
+ICQBuffer &ICQBuffer::operator << (unsigned long c)
+{
+ /* XXX:
+ * WARNING! BUG HERE. sizeof(long) is not 4 on 64bit platform */
+ c = htonl(c);
+ pack((char*)&c, 4);
+ return *this;
+}
+
+ICQBuffer &ICQBuffer::operator << (bool b)
+{
+ char c = b ? (char)1 : (char)0;
+ pack(&c, 1);
+ return *this;
+}
+
+//this FAILES for extended message and should be fixed, Noragen.
+ICQBuffer &ICQBuffer::operator >> (QString &str)
+{
+ unsigned short s;
+ str = "";
+
+ *this >> s;
+ s = htons(s);
+ if (s == 0)
+ return *this;
+ if (s > size() - m_posRead)
+ s = (unsigned short)(size() - m_posRead);
+ unpack(str, s);
+ return *this;
+}
+
+ICQBuffer &ICQBuffer::operator >> (string &s)
+{
+ unsigned short size;
+ *this >> size;
+ size = htons(size);
+ s.erase();
+ if (size){
+ if (size > this->size() - m_posRead)
+ size = (unsigned short)(this->size() - m_posRead);
+ s.append((unsigned)size, '\x00');
+ unpack((char*)s.c_str(), size);
+ }
+ return *this;
+}
+
+ICQBuffer &ICQBuffer::operator >> (char &c)
+{
+ if (unpack(&c, 1) != 1)
+ c = 0;
+ return *this;
+}
+
+ICQBuffer &ICQBuffer::operator >> (unsigned short &c)
+{
+ if (unpack((char*)&c, 2) != 2)
+ c = 0;
+ c = ntohs(c);
+ return *this;
+}
+
+ICQBuffer &ICQBuffer::operator >> (unsigned long &c)
+{
+ /* XXX:
+ * WARNING! BUG HERE. sizeof(long) is not 4 on 64bit platform */
+ if (unpack((char*)&c, 4) != 4)
+ c = 0;
+ c = ntohl(c);
+ return *this;
+}
+
+ICQBuffer &ICQBuffer::operator >> (int &c)
+{
+ if (unpack((char*)&c, 4) != 4)
+ c = 0;
+ c = ntohl(c);
+ return *this;
+}
+
+void ICQBuffer::packScreen(const QString &screen)
+{
+ char len = screen.utf8().length();
+ pack(&len, 1);
+ pack(screen.utf8(), len);
+}
+
+void ICQBuffer::unpackStr32(string &s)
+{
+ unsigned long size;
+ *this >> size;
+ size = htonl(size);
+ s.erase();
+ if (size == 0) return;
+ if (size > this->size() - m_posRead)
+ size = this->size() - m_posRead;
+ s.append(size, '\x00');
+ unpack((char*)s.c_str(), size);
+}
+
+void ICQBuffer::packStr32(const QString &s)
+{
+ unsigned long size = s.length();
+ pack(size);
+ pack(s, size);
+}
+
+void ICQBuffer::pack32(const Buffer &b)
+{
+ /* XXX:
+ * WARNING! BUG HERE. sizeof(long) is not 4 on 64bit platform */
+ unsigned long size = b.size() - b.readPos();
+ *this << (unsigned long)htonl(size);
+ pack(b.data(b.readPos()), size);
+}
+
+void ICQBuffer::pack(const QString &s)
+{
+ unsigned short size = (unsigned short)(s.length());
+ *this << size;
+ pack(s, size);
+}
+/*
+void ICQBuffer::pack(const char *d, unsigned size)
+{
+ allocate(m_posWrite + size, 1024);
+ memcpy(m_data + m_posWrite, d, size);
+ m_posWrite += size;
+ if (m_posWrite > m_size) m_size = m_posWrite;
+}
+*/
+/*
+void ICQBuffer::pack(const QString &s)
+{
+ QString cstr = s.utf8();
+ unsigned short size = (unsigned short)(s.length());
+ *this << size;
+ pack(cstr, size);
+}*/
+
+void ICQBuffer::pack(unsigned short s)
+{
+ SWAP_S(s);
+ pack((char*)&s, 2);
+}
+
+void ICQBuffer::pack(unsigned long s)
+{
+ /* XXX:
+ * WARNING! BUG HERE. sizeof(long) is not 4 on 64bit platform */
+ unsigned int i = s;
+ SWAP_L(i);
+ pack((char*)&i, 4);
+}
+
+bool ICQBuffer::unpackStr(QString &str)
+{
+ unsigned short s;
+ str = QString::null;
+ *this >> s;
+ if (s == 0)
+ return false;
+ if (s > size() - m_posRead)
+ s = (unsigned short)(size() - m_posRead);
+ unpack(str, s);
+ return true;
+}
+/*
+bool ICQBuffer::unpackStr(QString &str)
+{
+ unsigned short s;
+ str = "";
+ *this >> s;
+ if (s == 0)
+ return false;
+ if (s > size() - m_posRead)
+ s = (unsigned short)(size() - m_posRead);
+ unpack(str, s);
+ return true;
+}
+*/
+bool ICQBuffer::unpackStr32(QString &str)
+{
+ unsigned long s;
+ *this >> s;
+ s = ntohl(s);
+ str = "";
+ if (s == 0)
+ return false;
+ if (s > size() - m_posRead)
+ s = size() - m_posRead;
+ unpack(str, s);
+ return true;
+}
+
+bool ICQBuffer::unpackStr32(QByteArray &str)
+{
+ unsigned long s;
+ *this >> s;
+ s = ntohl(s);
+ str = QByteArray();
+ if (s == 0)
+ return false;
+ if (s > size() - m_posRead)
+ s = size() - m_posRead;
+ unpack(str, s);
+ return true;
+}
+
+QString ICQBuffer::unpackScreen()
+{
+ char len;
+ QString res;
+
+ *this >> len;
+ /* 13 isn't right, AIM allows 16. But when we get a longer
+ name, we *must* unpack them if we won't lose the TLVs
+ behind the Screenname ... */
+ if (len > 16)
+ log(L_DEBUG,"Too long Screenname! Length: %d",len);
+ unpack(res, len);
+ return res;
+}
+
+unsigned ICQBuffer::unpack(char *d, unsigned s)
+{
+ unsigned readn = size() - m_posRead;
+ if (s < readn)
+ readn = s;
+ memcpy(d, data() + m_posRead, readn);
+ m_posRead += readn;
+ return readn;
+}
+
+unsigned ICQBuffer::unpack(QString &d, unsigned s)
+{
+ unsigned readn = size() - m_posRead;
+ if (s < readn)
+ readn = s;
+ d = QString::fromUtf8(data() + m_posRead, readn);
+ m_posRead += readn;
+ return readn;
+}
+/*
+unsigned ICQBuffer::unpack(QString &d, unsigned s)
+{
+ unsigned readn = size() - m_posRead;
+ if (s < readn)
+ readn = s;
+ d = QString(data() + m_posRead, readn + 1);
+ m_posRead += readn;
+ return readn;
+}
+*/
+unsigned ICQBuffer::unpack(QByteArray &d, unsigned s)
+{
+ unsigned readn = size() - m_posRead;
+ if (s < readn)
+ readn = s;
+ d = QByteArray::duplicate(data() + m_posRead, readn);
+ unsigned size = d.size();
+ d.resize(size + 1);
+ d.data()[size] = '\0';
+ m_posRead += readn;
+ return readn;
+}
+
+void ICQBuffer::unpack(unsigned short &c)
+{
+ if (unpack((char*)&c, 2) != 2)
+ c = 0;
+ SWAP_S(c);
+}
+
+void ICQBuffer::unpack(unsigned long &c)
+{
+ // FIXME: This needs to be rewritten for 64-bit machines.
+ // Kludge for now.
+ unsigned int i;
+ if (unpack((char*)&i, 4) != 4)
+ i = 0;
+ SWAP_L(i);
+ c = i;
+}
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/icqbuffer.h
^
|
@@ -1,142 +1,147 @@
-/***************************************************************************
- icqbuffer.h - description
- -------------------
- begin : Fri Jan 05 2007
- copyright : (C) 2007 by Christian Ehrlicher
- email : ch.ehrlicher@gmx.de
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * 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 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-#ifndef _ICQBUFFER_H
-#define _ICQBUFFER_H
-
-#include "buffer.h"
-#include "socket.h"
-
-class ICQBuffer;
-class Tlv
-{
-public:
- Tlv(unsigned short num = 0, unsigned short size = 0, const char *data = NULL);
- unsigned short Num() const { return m_nNum; }
- unsigned short Size() const { return m_nSize; }
- const char *Data() const { return m_data.data(); }
- operator char *() const { return m_data.data(); }
- const QByteArray &byteArray() const { return m_data; }
- operator uint16_t () const;
- operator uint32_t () const;
-protected:
- unsigned int m_nNum;
- unsigned int m_nSize;
- QByteArray m_data;
-};
-
-class TlvList : public QValueList<Tlv*>
-{
-public:
- TlvList();
- TlvList(ICQBuffer&, unsigned nTlvs = ~0U);
- ~TlvList();
- // return Tlv<num>, since there can be more than one Tlv<num> inside
- // a package, you can specificy how much Tlv<num> should be skipped
- Tlv *operator() (unsigned short num, int skip = 0);
-};
-
-class ICQBuffer : public Buffer
-{
-public:
- ICQBuffer(unsigned size = 0);
- ICQBuffer(const QByteArray &ba);
- ICQBuffer(Tlv&);
- virtual ~ICQBuffer();
-
- void tlv(unsigned short n, const char *data, unsigned short len);
- void tlv(unsigned short n) { tlv(n, NULL, 0); }
- void tlv(unsigned short n, const char *data);
- void tlv(unsigned short n, unsigned short c);
- void tlv(unsigned short n, int c) { tlv(n, (unsigned short)c); }
- void tlv(unsigned short n, unsigned long c);
- void tlv(unsigned short n, long c) { tlv(n, (unsigned long)c); }
- void tlv(unsigned short n, Buffer &b) { tlv(n, b.data(), (unsigned short)(b.size())); }
-
- void tlvLE(unsigned short n, const char *data, unsigned short len);
- void tlvLE(unsigned short n, const char *data);
- void tlvLE(unsigned short n, char c) { tlvLE(n, &c, 1); }
- void tlvLE(unsigned short n, unsigned short c);
- void tlvLE(unsigned short n, unsigned long c);
- void tlvLE(unsigned short n, Buffer &b) { tlvLE(n, b.data(), (unsigned short)(b.size())); }
-
- ICQBuffer &operator << (const TlvList&);
- ICQBuffer &operator << (const QString &s); // utf8
- ICQBuffer &operator << (const QCString &s);
- ICQBuffer &operator << (const QByteArray &s);
- ICQBuffer &operator << (const Buffer &b);
- ICQBuffer &operator << (char c);
- ICQBuffer &operator << (unsigned char c) { return operator << ((char)c); }
- ICQBuffer &operator << (const char *str);
- ICQBuffer &operator << (unsigned short c);
- ICQBuffer &operator << (int c) { return operator << ((unsigned short)c); }
- ICQBuffer &operator << (unsigned long c);
- ICQBuffer &operator << (long c) { return operator << ((unsigned long)c); }
- ICQBuffer &operator << (const bool b);
-
- ICQBuffer &operator >> (QCString &s); // size is 2 byte & little endian!
- ICQBuffer &operator >> (char &c);
- ICQBuffer &operator >> (unsigned char &c) { return operator >> ((char&)c); }
- ICQBuffer &operator >> (unsigned short &c);
- ICQBuffer &operator >> (unsigned long &c);
- ICQBuffer &operator >> (int &c);
-
- void pack(const QString &s);
- void pack(const QCString &s);
- void pack(const char *d, unsigned size) { Buffer::pack(d, size); }
- void pack(char c) { *this << c; }
- void pack(unsigned char c) { *this << c; }
- void pack(unsigned short c);
- void pack(unsigned long c);
- void pack(long c) { pack((unsigned long)c); }
-
- void packScreen(const QString &);
- void packStr32(const QCString &);
- void pack32(const Buffer &b);
-
- // 2 byte size + string
- bool unpackStr(QString &s); // utf8
- bool unpackStr(QCString &s);
- // 4 byte size + string
- bool unpackStr32(QCString &s);
- bool unpackStr32(QByteArray &s);
- QString unpackScreen();
-
- void unpack(char &c) { *this >> c; }
- void unpack(unsigned char &c) { *this >> c; }
- unsigned unpack(char *d, unsigned size);
- unsigned unpack(QString &d, unsigned size); // utf8
- unsigned unpack(QCString &d, unsigned size);
- unsigned unpack(QByteArray &d, unsigned size);
- void unpack(unsigned short &c);
- void unpack(unsigned long &c);
-};
-
-class ICQClientSocket : public SIM::ClientSocket
-{
-public:
- ICQClientSocket(SIM::ClientSocketNotify *notify, SIM::Socket *sock = NULL)
- : ClientSocket(notify, sock) {};
- ~ICQClientSocket() {};
-
- virtual ICQBuffer &readBuffer() { return m_readICQBuffer; }
- virtual ICQBuffer &writeBuffer() { return m_writeICQBuffer; }
-protected:
- ICQBuffer m_readICQBuffer;
- ICQBuffer m_writeICQBuffer;
-};
-
-#endif // _ICQBUFFER_H
+/***************************************************************************
+ icqbuffer.h - description
+ -------------------
+ begin : Fri Jan 05 2007
+ copyright : (C) 2007 by Christian Ehrlicher
+ email : ch.ehrlicher@gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+#ifndef _ICQString_H
+#define _ICQString_H
+
+#include "buffer.h"
+#include "socket.h"
+#include <string> //Fixme
+
+using namespace std;
+
+class ICQBuffer;
+class Tlv
+{
+public:
+ Tlv(unsigned short num = 0, unsigned short size = 0, const char *data = NULL);
+ unsigned short Num() const { return m_nNum; }
+ unsigned short Size() const { return m_nSize; }
+ const char *Data() const { return m_data.data(); }
+ operator char *() const { return m_data.data(); }
+ const QByteArray &byteArray() const { return m_data; }
+ operator uint16_t () const;
+ operator uint32_t () const;
+protected:
+ unsigned int m_nNum;
+ unsigned int m_nSize;
+ QByteArray m_data;
+};
+
+class TlvList : public QValueList<Tlv*>
+{
+public:
+ TlvList();
+ TlvList(ICQBuffer&, unsigned nTlvs = ~0U);
+ ~TlvList();
+ // return Tlv<num>, since there can be more than one Tlv<num> inside
+ // a package, you can specificy how much Tlv<num> should be skipped
+ Tlv *operator() (unsigned short num, int skip = 0);
+};
+
+class ICQBuffer : public Buffer
+{
+public:
+ ICQBuffer(unsigned size = 0);
+ ICQBuffer(const QByteArray &ba);
+ ICQBuffer(Tlv&);
+ virtual ~ICQBuffer();
+
+ void tlv(unsigned short n, const char *data, unsigned short len);
+ void tlv(unsigned short n) { tlv(n, NULL, 0); }
+ void tlv(unsigned short n, const char *data);
+ void tlv(unsigned short n, unsigned short c);
+ void tlv(unsigned short n, int c) { tlv(n, (unsigned short)c); }
+ void tlv(unsigned short n, unsigned long c);
+ void tlv(unsigned short n, long c) { tlv(n, (unsigned long)c); }
+ void tlv(unsigned short n, Buffer &b) { tlv(n, b.data(), (unsigned short)(b.size())); }
+
+ void tlvLE(unsigned short n, const char *data, unsigned short len);
+ void tlvLE(unsigned short n, const char *data);
+ void tlvLE(unsigned short n, char c) { tlvLE(n, &c, 1); }
+ void tlvLE(unsigned short n, unsigned short c);
+ void tlvLE(unsigned short n, unsigned long c);
+ void tlvLE(unsigned short n, Buffer &b) { tlvLE(n, b.data(), (unsigned short)(b.size())); }
+
+ ICQBuffer &operator << (const TlvList&);
+ ICQBuffer &operator << (const QString &s); // utf8
+ //ICQBuffer &operator << (const QString &s);
+ ICQBuffer &operator << (const QByteArray &s);
+ ICQBuffer &operator << (const Buffer &b);
+ ICQBuffer &operator << (char c);
+ ICQBuffer &operator << (unsigned char c) { return operator << ((char)c); }
+ ICQBuffer &operator << (const char *str);
+ ICQBuffer &operator << (unsigned short c);
+ ICQBuffer &operator << (int c) { return operator << ((unsigned short)c); }
+ ICQBuffer &operator << (unsigned long c);
+ ICQBuffer &operator << (long c) { return operator << ((unsigned long)c); }
+ ICQBuffer &operator << (const bool b);
+
+ ICQBuffer &operator >> (QString &s); // size is 2 byte & little endian! //this is FAILES for extended message and should be fixed, Noragen.
+ ICQBuffer &operator >> (string &s);
+ ICQBuffer &operator >> (char &c);
+ ICQBuffer &operator >> (unsigned char &c) { return operator >> ((char&)c); }
+ ICQBuffer &operator >> (unsigned short &c);
+ ICQBuffer &operator >> (unsigned long &c);
+ ICQBuffer &operator >> (int &c);
+
+ void pack(const QString &s);
+// void pack(const QString &s);
+ void pack(const char *d, unsigned size) { Buffer::pack(d, size); }
+ void pack(char c) { *this << c; }
+ void pack(unsigned char c) { *this << c; }
+ void pack(unsigned short c);
+ void pack(unsigned long c);
+ void pack(long c) { pack((unsigned long)c); }
+
+ void packScreen(const QString &);
+ void packStr32(const QString &);
+ void pack32(const Buffer &b);
+
+ // 2 byte size + string
+ bool unpackStr(QString &s); // utf8
+ //bool unpackStr(QString &s);
+ // 4 byte size + string
+ void unpackStr32(string &s);
+ bool unpackStr32(QString &s);
+ bool unpackStr32(QByteArray &s);
+ QString unpackScreen();
+
+ void unpack(char &c) { *this >> c; }
+ void unpack(unsigned char &c) { *this >> c; }
+ unsigned unpack(char *d, unsigned size);
+ unsigned unpack(QString &d, unsigned size); // utf8
+ //unsigned unpack(QString &d, unsigned size);
+ unsigned unpack(QByteArray &d, unsigned size);
+ void unpack(unsigned short &c);
+ void unpack(unsigned long &c);
+};
+
+class ICQClientSocket : public SIM::ClientSocket
+{
+public:
+ ICQClientSocket(SIM::ClientSocketNotify *notify, SIM::Socket *sock = NULL)
+ : ClientSocket(notify, sock) {};
+ ~ICQClientSocket() {};
+
+ virtual ICQBuffer &readBuffer() { return m_readICQString; }
+ virtual ICQBuffer &writeBuffer() { return m_writeICQString; }
+protected:
+ ICQBuffer m_readICQString;
+ ICQBuffer m_writeICQString;
+};
+
+#endif // _ICQString_H
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/icqclient.cpp
^
|
@@ -804,22 +804,26 @@
m_processTimer->start(delay);
}
-QCString ICQClient::cryptPassword()
+QByteArray ICQClient::cryptPassword()
{
unsigned char xor_table[] =
{
0xf3, 0x26, 0x81, 0xc4, 0x39, 0x86, 0xdb, 0x92,
0x71, 0xa3, 0xb9, 0xe6, 0x53, 0x7a, 0x95, 0x7c
};
- QCString pswd = getContacts()->fromUnicode(NULL, getPassword());
- QCString res;
+ QString pswd = getContacts()->fromUnicode(NULL, getPassword());
+ char buf[8];
+ int len=0;
for (int j = 0; j < 8; j++){
- char c = pswd[j];
- if (c == 0)
+ QChar c = pswd[j];
+ if (c == '\0')
break;
- c = (char)(c ^ xor_table[j]);
- res += c;
+ c = (QChar)(c ^ xor_table[j]);
+ buf[j] = c;
+ len++;
}
+ QByteArray res;
+ res.duplicate(buf,len);
return res;
}
@@ -2382,7 +2386,7 @@
ICQUserData *data = findContact(ar.screen, NULL, false, contact);
DirectClient *dc = dynamic_cast<DirectClient*>(data ? data->Direct.object() : 0);
if (dc){
- QCString answer;
+ QString answer;
if (data->Version.toULong() >= 10){
answer = t->tmpl.utf8();
}else{
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/icqclient.h
^
|
@@ -33,8 +33,8 @@
const unsigned MESSAGE_DIRECT = 0x0100;
-const unsigned STATUS_INVISIBLE = 2;
-const unsigned STATUS_OCCUPIED = 100;
+//const unsigned STATUS_INVISIBLE = 2; //took over to contacts.h
+//const unsigned STATUS_OCCUPIED = 100; //took over to contacts.h
const unsigned char ICQ_TCP_VERSION = 0x09;
@@ -591,9 +591,9 @@
void requestReverseConnection(const QString &screen, DirectSocket *socket);
void accept(SIM::Message *msg, ICQUserData *data);
SIM::Message *parseMessage(unsigned short type, const QString &screen,
- const QCString &p, ICQBuffer &packet, MessageId &id, unsigned cookie);
+ const QString &p, ICQBuffer &packet, MessageId &id, unsigned cookie);
bool messageReceived(SIM::Message*, const QString &screen);
- static bool parseRTF(const QCString &str, SIM::Contact *contact, QString &result);
+ static bool parseRTF(const QString &str, SIM::Contact *contact, QString &result);
static QString pictureFile(const ICQUserData *data);
virtual QImage userPicture(unsigned id);
QImage userPicture(ICQUserData *d);
@@ -675,7 +675,7 @@
void requestService(ServiceSocket*);
class SSBISocket *getSSBISocket();
unsigned long fullStatus(unsigned status);
- QCString cryptPassword();
+ QByteArray cryptPassword();
virtual void connect_ready();
virtual void packet_ready();
const char* error_message(unsigned short error);
@@ -736,7 +736,7 @@
bool isOwnData(const QString &screen);
void packInfoList(const QString &str);
QString packContacts(SIM::ContactsMessage *msg, ICQUserData *data, CONTACTS_MAP &c);
- QCString createRTF(QString &text, QString &part, unsigned long foreColor, SIM::Contact *contact, unsigned max_size);
+ QString createRTF(QString &text, QString &part, unsigned long foreColor, SIM::Contact *contact, unsigned max_size);
QString removeImages(const QString &text, bool icqSmiles);
void ackMessage(SendMsg &s);
void accept(SIM::Message *msg, const QString &dir, SIM::OverwriteMode overwrite);
@@ -761,7 +761,7 @@
void pluginAnswer(unsigned plugin_type, unsigned long uin, ICQBuffer &b);
void packMessage(ICQBuffer &b, SIM::Message *msg, ICQUserData *data, unsigned short &type, bool bDirect, unsigned short flags=ICQ_TCPxMSG_NORMAL);
void packExtendedMessage(SIM::Message *msg, ICQBuffer &buf, ICQBuffer &msgBuf, ICQUserData *data);
- bool ackMessage(SIM::Message *msg, unsigned short ackFlags, const QCString &str);
+ bool ackMessage(SIM::Message *msg, unsigned short ackFlags, const QString &str);
void fetchProfile(ICQUserData *data);
void fetchAwayMessage(ICQUserData *data);
void fetchProfiles();
@@ -1010,3 +1010,4 @@
#endif
+
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/icqdirect.cpp
^
|
@@ -657,7 +657,7 @@
m_socket->readBuffer().unpack(type);
m_socket->readBuffer().unpack(ackFlags);
m_socket->readBuffer().unpack(msgFlags);
- QCString msg_str;
+ QString msg_str;
m_socket->readBuffer() >> msg_str;
Message *m;
switch (command){
@@ -801,7 +801,7 @@
if ((*it).type == PLUGIN_AR){
Contact *contact = NULL;
m_client->findContact(m_client->screen(m_data), NULL, false, contact);
- m_data->AutoReply.str() = getContacts()->toUnicode(contact,msg_str);
+ m_data->AutoReply.str() = getContacts()->toUnicode(contact,QCString(msg_str.data()));
m_queue.erase(it);
itDeleted = true;
break;
@@ -853,7 +853,7 @@
if (msg_str.isEmpty()){
msg->setError(I18N_NOOP("Send message fail"));
}else{
- QString err = getContacts()->toUnicode(m_client->getContact(m_data), msg_str);
+ QString err = getContacts()->toUnicode(m_client->getContact(m_data), QCString(msg_str.data()));
msg->setError(err);
}
EventMessageSent(msg).process();
@@ -1130,7 +1130,7 @@
return;
}
- QCString message;
+ QString message;
if (msg)
message = msg;
@@ -1248,7 +1248,7 @@
void DirectClient::declineMessage(Message *msg, const QString &reason)
{
- QCString r;
+ QString r;
r = getContacts()->fromUnicode(m_client->getContact(m_data), reason);
unsigned short seq = 0;
switch (msg->type()){
@@ -1286,7 +1286,7 @@
continue;
}
if (sm.msg){
- QCString message;
+ QString message;
ICQBuffer &mb = m_socket->writeBuffer();
unsigned short flags = ICQ_TCPxMSG_NORMAL;
if (sm.msg->getFlags() & MESSAGE_URGENT)
@@ -1313,7 +1313,7 @@
sm.type = CAP_UTF;
}else{
message = getContacts()->fromUnicode(m_client->getContact(m_data), sm.msg->getPlainText());
- EventSend e(sm.msg, message);
+ EventSend e(sm.msg, QCString(message.data()));
e.process();
message = e.localeText();
}
@@ -1407,7 +1407,7 @@
mb.pack((unsigned short)(*it).icq_type);
mb.pack((unsigned short)0);
mb.pack((unsigned short)0);
- QCString message;
+ QString message;
mb << message;
sendPacket();
}
@@ -1688,18 +1688,18 @@
m_socket->error_state("Bad command in init receive");
return;
}
- QCString fileName;
+ QString fileName;
char isDir;
m_socket->readBuffer() >> isDir >> fileName;
- QString fName = getContacts()->toUnicode(m_client->getContact(m_data), fileName);
- QCString dir;
+ QString fName = getContacts()->toUnicode(m_client->getContact(m_data), QCString(fileName.data()));
+ QString dir;
unsigned long n;
m_socket->readBuffer() >> dir;
m_socket->readBuffer().unpack(n);
if (m_notify)
m_notify->transfer(false);
if (!dir.isEmpty())
- fName = getContacts()->toUnicode(m_client->getContact(m_data), dir) + '/' + fName;
+ fName = getContacts()->toUnicode(m_client->getContact(m_data), QCString(dir.data())) + '/' + fName;
if (isDir)
fName += '/';
m_state = Wait;
@@ -1925,8 +1925,8 @@
dir = dir.replace('/', '\\');
fn = fn.mid(n);
}
- QCString s1 = getContacts()->fromUnicode(m_client->getContact(m_data), fn);
- QCString s2;
+ QString s1 = getContacts()->fromUnicode(m_client->getContact(m_data), fn);
+ QString s2;
if (!dir.isEmpty())
s2 = getContacts()->fromUnicode(m_client->getContact(m_data), dir);
m_socket->writeBuffer() << s1.data() << s2.data();
@@ -2083,3 +2083,4 @@
return true;
}
+
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/icqicmb.cpp
^
|
@@ -283,7 +283,7 @@
break;
}
if ((*it).msg){
- QCString answer;
+ QString answer;
socket()->readBuffer() >> answer;
if (ackMessage((*it).msg, ackFlags, answer)){
ackMessage(*it);
@@ -323,12 +323,12 @@
}
if (plugin_type == PLUGIN_AR){
- QCString answer;
+ QString answer;
socket()->readBuffer() >> answer;
log(L_DEBUG, "Autoreply from %s %s", screen.latin1(), answer.data());
Contact *contact;
ICQUserData *data = findContact(screen, NULL, false, contact);
- if (data && data->AutoReply.setStr(getContacts()->toUnicode(contact, answer))){
+ if (data && data->AutoReply.setStr(getContacts()->toUnicode(contact, QCString(answer.data())))){
EventContact e(contact, EventContact::eChanged);
e.process();
}
@@ -466,7 +466,7 @@
return;
}
unsigned char type, flags;
- QCString msg_str;
+ QString msg_str;
msg >> type;
msg >> flags;
msg >> msg_str;
@@ -701,7 +701,7 @@
processSendQueue();
}
-bool ICQClient::ackMessage(Message *msg, unsigned short ackFlags, const QCString &msg_str)
+bool ICQClient::ackMessage(Message *msg, unsigned short ackFlags, const QString &msg_str)
{
switch (ackFlags){
case ICQ_TCPxACK_OCCUPIED:
@@ -1108,7 +1108,7 @@
adv.unpack(msgType);
adv.unpack(msgState);
adv.unpack(msgFlags);
- QCString msg;
+ QString msg;
adv >> msg;
switch (msgType){
@@ -1159,7 +1159,7 @@
if (!msg.isEmpty()){
Contact *contact;
ICQUserData *data = findContact(screen, NULL, false, contact);
- QString m = getContacts()->toUnicode(contact, msg);
+ QString m = getContacts()->toUnicode(contact, QCString(msg.data()));
data->AutoReply.str() = m;
EventContact e(contact, EventContact::eChanged);
e.process();
@@ -1171,8 +1171,8 @@
if (!msg.isEmpty() || (msgType == ICQ_MSGxEXT)){
if (adv.readPos() < adv.writePos())
copy.pack(adv.data(adv.readPos()), adv.writePos() - adv.readPos());
- log(L_DEBUG, "Msg size=%lu type=%u", (unsigned long) msg.size(), msgType);
- if (msg.size() || (msgType == ICQ_MSGxEXT)){
+ log(L_DEBUG, "Msg size=%lu type=%u", (unsigned long) msg.length(), msgType);
+ if (msg.length() || (msgType == ICQ_MSGxEXT)){
Message *m = parseMessage(msgType, screen, msg, adv, id, cookie1 | (cookie2 << 16));
if (m){
if ((m_send.id == id) && (m_send.screen == screen)){
@@ -1303,7 +1303,7 @@
if (!response.isEmpty()){
Contact *contact = NULL;
findContact(screen, NULL, false, contact);
- QCString r = getContacts()->fromUnicode(contact, response);
+ QString r = getContacts()->fromUnicode(contact, response);
unsigned short size = (unsigned short)(r.length() + 1);
socket()->writeBuffer().pack(size);
socket()->writeBuffer().pack(r.data(), size);
@@ -1727,7 +1727,7 @@
return true;
}
}
- QCString text;
+ QString text;
switch (m_send.flags & SEND_MASK){
case SEND_RTF:
text = createRTF(m_send.text, m_send.part, m_send.msg->getForeground(), contact, MAX_TYPE2_MESSAGE_SIZE);
@@ -1739,7 +1739,7 @@
case SEND_TYPE2:{
m_send.part = getPart(m_send.text, MAX_TYPE2_MESSAGE_SIZE);
text = getContacts()->fromUnicode(contact, m_send.part);
- EventSend e(m_send.msg, text);
+ EventSend e(m_send.msg, QCString(text.data()));
e.process();
text = e.localeText();
break;
@@ -1846,7 +1846,7 @@
}
QString charset = bWide ? "unicode-2-0" : "us-ascii";
tlvs += new Tlv(0x0D, charset.length(), charset.latin1());
- QCString st;
+ QString st;
if (bWide){
for (i = 0; i < (int)(text.length()); i++){
unsigned short s = text[i].unicode();
@@ -1978,8 +1978,8 @@
msgBuf << 0x00020000L;
msgBuf.pack(ba.data(), ba.size());
}else{
- QCString msg_text = getContacts()->fromUnicode(getContact(data), text);
- EventSend e(m_send.msg, msg_text);
+ QString msg_text = getContacts()->fromUnicode(getContact(data), text);
+ EventSend e(m_send.msg, QCString(msg_text.data()));
e.process();
msg_text = e.localeText();
msgBuf << 0x0000FFFFL;
@@ -2235,3 +2235,4 @@
return ((m1.id_l == m2.id_l) && (m1.id_h == m2.id_h));
}
+
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/icqlists.cpp
^
|
@@ -656,8 +656,8 @@
}
case ICQ_SNACxLISTS_AUTHxREQUEST:{
QString screen = socket()->readBuffer().unpackScreen();
- QCString message;
- QCString charset;
+ QString message;
+ QString charset;
unsigned short have_charset;
socket()->readBuffer().unpackStr(message);
socket()->readBuffer() >> have_charset;
@@ -673,7 +673,7 @@
m = msg;
}else{
ICQAuthMessage *msg = new ICQAuthMessage(MessageICQAuthRequest, MessageAuthRequest);
- msg->setServerText(message);
+ msg->setServerText(QCString(message.data()));
msg->setCharset(charset);
m = msg;
}
@@ -688,7 +688,7 @@
/* we treat future grant as normal grant but it isn't the same...
http://iserverd1.khstu.ru/oscar/snac_13_15.html */
QString screen = socket()->readBuffer().unpackScreen();
- QCString message;
+ QString message;
Message *m = NULL;
socket()->readBuffer().unpackStr(message);
@@ -710,8 +710,8 @@
QString screen = socket()->readBuffer().unpackScreen();
char auth_ok;
socket()->readBuffer() >> auth_ok;
- QCString message;
- QCString charset;
+ QString message;
+ QString charset;
unsigned short have_charset;
socket()->readBuffer().unpackStr(message);
socket()->readBuffer() >> have_charset;
@@ -727,7 +727,7 @@
m = msg;
}else{
ICQAuthMessage *msg = new ICQAuthMessage(auth_ok ? MessageICQAuthGranted : MessageICQAuthRefused, auth_ok ? MessageAuthGranted : MessageAuthRefused);
- msg->setServerText(message);
+ msg->setServerText(QCString(message.data()));
msg->setCharset(charset);
m = msg;
}
@@ -1047,7 +1047,7 @@
TlvList *ICQClient::createListTlv(ICQUserData *data, Contact *contact)
{
TlvList *tlv = new TlvList;
- QCString name = contact->getName().utf8();
+ QString name = contact->getName().utf8();
*tlv += new Tlv(TLV_ALIAS, (unsigned short)(name.length()), name);
if (data->WaitAuth.toBool())
*tlv += new Tlv(TLV_WAIT_AUTH, 0, NULL);
@@ -1075,7 +1075,7 @@
sendPacket(true);
snac(ICQ_SNACxFAM_LISTS, cmd, true);
- QCString sName = name.utf8();
+ QString sName = name.utf8();
socket()->writeBuffer().pack(htons(sName.length()));
socket()->writeBuffer().pack(sName.data(), sName.length());
socket()->writeBuffer()
@@ -1093,7 +1093,7 @@
void ICQClient::sendRosterGrp(const QString &name, unsigned short grpId, unsigned short usrId)
{
- QCString sName = name.utf8();
+ QString sName = name.utf8();
snac(ICQ_SNACxFAM_LISTS, ICQ_SNACxLISTS_UPDATE, true);
socket()->writeBuffer().pack(sName.data(), sName.length());
socket()->writeBuffer()
@@ -1293,7 +1293,7 @@
break;
}
if(!img.save(&buf, "JPEG")) {
- log(L_ERROR, "Can't save QImage to QBuffer");
+ log(L_ERROR, "Can't save QImage to QString");
break;
}
buf.close();
@@ -1500,7 +1500,7 @@
snac(ICQ_SNACxFAM_LISTS, ICQ_SNACxLISTS_REQUEST_AUTH);
socket()->writeBuffer().packScreen(screen(data));
- QCString message;
+ QString message;
QString charset;
if (hasCap(data, CAP_RTF) || hasCap(data, CAP_UTF)){
message = msg->getPlainText().utf8();
@@ -1561,8 +1561,8 @@
snac(ICQ_SNACxFAM_LISTS, ICQ_SNACxLISTS_AUTHxSEND);
socket()->writeBuffer().packScreen(screen(data));
- QCString message;
- QCString charset;
+ QString message;
+ QString charset;
if (hasCap(data, CAP_RTF) || hasCap(data, CAP_UTF)){
message = msg->getPlainText().utf8();
charset = "utf-8";
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/icqlocation.cpp
^
|
@@ -57,7 +57,7 @@
QString ICQClient::convert(const char *text, unsigned size, TlvList &tlvs, unsigned n)
{
- QCString charset = "us-ascii";
+ QString charset("us-ascii");
Tlv *tlvCharset = NULL;
for (unsigned i = 0; i < tlvs.count(); i++){
Tlv *tlv = tlvs[i];
@@ -491,7 +491,8 @@
addCapability(cap, CAP_AIM_SENDFILE);
addCapability(cap, CAP_AIM_BUDDYLIST);
}else{
- addCapability(cap, CAP_DIRECT);
+ addCapability(cap, CAP_AIM_SENDFILE); //Since we add this, ICQ6 accepts the client as filetransfer partner
+ addCapability(cap, CAP_DIRECT);
addCapability(cap, CAP_SRV_RELAY);
addCapability(cap, CAP_XTRAZ);
if (getSendFormat() <= 1)
@@ -630,3 +631,4 @@
}
+
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/icqlogin.cpp
^
|
@@ -96,7 +96,7 @@
case ICQ_SNACxLOGIN_AUTHxKEYxRESPONSE:
log(L_DEBUG, "Sending MD5 key");
if (!data.owner.Screen.str().isEmpty() || data.owner.Uin.toULong()){
- QCString md5_key;
+ QString md5_key;
socket()->readBuffer().unpackStr(md5_key);
snac(ICQ_SNACxFAM_LOGIN, ICQ_SNACxLOGIN_MD5xLOGIN, false, false);
if (data.owner.Uin.toULong()){
@@ -106,10 +106,10 @@
}else{
socket()->writeBuffer().tlv(0x0001, data.owner.Screen.str());
}
- QCString md = md5_key;
+ QString md = md5_key;
md += getContacts()->fromUnicode(NULL, getPassword());
md += "AOL Instant Messenger (SM)";
- md = md5(md);
+ md = QCString(md5(md));
socket()->writeBuffer().tlv(0x0025, md.data(), md.length());
if (data.owner.Uin.toULong()){
socket()->writeBuffer().tlv(0x0003, "ICQ Inc. - Product of ICQ (TM).2003b.5.56.1.3916.85"); //ToDo: Should be updated anytime
@@ -166,7 +166,7 @@
<< 0x00000000L << 0x94680000L << 0x94680000L
<< 0x00000000L << 0x00000000L << 0x00000000L
<< 0x00000000L;
- QCString pswd = getContacts()->fromUnicode(NULL, getPassword());
+ QString pswd = getContacts()->fromUnicode(NULL, getPassword());
unsigned short len = (unsigned short)(pswd.length() + 1);
msg.pack(len);
msg.pack(pswd.data(), len);
@@ -193,15 +193,15 @@
return;
}
if (data.owner.Uin.toULong() && ! getUseMD5()){
- QCString pswd = cryptPassword();
- log(L_DEBUG, "Login %lu [%s]", data.owner.Uin.toULong(), pswd.data());
+ QByteArray pswd = cryptPassword();
+ log(L_DEBUG, "Login %lu [%s]", data.owner.Uin.toULong(), /*pswd.c_str()*/"");
char uin[20];
sprintf(uin, "%lu", data.owner.Uin.toULong());
flap(ICQ_CHNxNEW);
socket()->writeBuffer() << 0x00000001L;
socket()->writeBuffer().tlv(0x0001, uin);
- socket()->writeBuffer().tlv(0x0002, pswd.data(), pswd.length());
+ socket()->writeBuffer().tlv(0x0002, pswd.data(), pswd.size());
socket()->writeBuffer().tlv(0x0003, "ICQBasic"); // ID String, currently ICQ 5.1 (21.08.2006)
socket()->writeBuffer().tlv(0x0016, 0x010A); // ID Number
socket()->writeBuffer().tlv(0x0017, 0x0014); // major
@@ -251,7 +251,7 @@
<< 0x00000000L << 0x94680000L << 0x94680000L
<< 0x00000000L << 0x00000000L << 0x00000000L
<< 0x00000000L;
- QCString pswd = getContacts()->fromUnicode(NULL, getPassword());
+ QString pswd = getContacts()->fromUnicode(NULL, getPassword());
unsigned short len = (unsigned short)(pswd.length() + 1);
msg.pack(len);
msg.pack(pswd.data(), len);
@@ -373,7 +373,7 @@
socket()->error_state(I18N_NOOP("Close packet from server"));
return;
}
- QCString host = tlv_host->byteArray().data();
+ QString host(tlv_host->byteArray().data());
int idx = host.find(':');
if (idx == -1){
log(L_ERROR, "Bad host address %s", host.data());
@@ -389,3 +389,4 @@
m_cookie.resize(m_cookie.size() - 1); // tlv has \0 terminator... time for Qt4
}
+
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/icqmessage.cpp
^
|
@@ -108,7 +108,7 @@
QString IcqContactsMessage::getContacts() const
{
- QCString serverText = getServerText();
+ QString serverText = getServerText();
if (serverText.isEmpty())
return ContactsMessage::getContacts();
return serverText; // this is wrong ... but I'm currently unsure what'ssaved in there
@@ -134,7 +134,7 @@
QString ICQAuthMessage::getText() const
{
- QCString serverText = getServerText();
+ QString serverText = getServerText();
if (serverText.isEmpty())
return Message::getText();
QString charset = getCharset();
@@ -172,7 +172,7 @@
return false;
}
-static bool h2b(const char *&p, QCString &cap)
+static bool h2b(const char *&p, QString &cap)
{
char r1, r2;
if (h2b(p, r1) && h2b(p, r2)){
@@ -182,7 +182,7 @@
return false;
}
-static bool parseFE(QCString str, QValueList<QCString> &l, unsigned n)
+static bool parseFE(QString str, QValueList<QString> &l, unsigned n)
{
int idx = str.find('\xFE');
while(idx != -1) {
@@ -192,17 +192,17 @@
}
l += str;
for( unsigned i = l.count(); i < n; i++ )
- l += QCString();
+ l += QString();
return true;
}
-static Message *parseTextMessage(const QCString &str, const QCString &_pp, Contact *contact)
+static Message *parseTextMessage(const QString &str, const QString &_pp, Contact *contact)
{
if (str.isEmpty())
return NULL;
log(L_DEBUG, "Text message: %s %s", str.data(), _pp.data());
if (_pp.length() == 38){
- QCString cap;
+ QString cap;
const char *pp = _pp.data();
if ((*(pp++) == '{') &&
h2b(pp, cap) && h2b(pp, cap) && h2b(pp, cap) && h2b(pp, cap) &&
@@ -234,26 +234,26 @@
}
}
Message *m = new Message;
- m->setServerText(str);
+ m->setServerText(QCString(str.data()));
return m;
}
-static Message *parseURLMessage(const QCString &str)
+static Message *parseURLMessage(const QString &str)
{
- QValueList<QCString> l;
+ QValueList<QString> l;
if (!parseFE(str, l, 2)){
log(L_WARN, "Parse error URL message");
return NULL;
}
UrlMessage *m = new UrlMessage;
- m->setServerText(l[0]);
- m->setUrl(l[1]);
+ m->setServerText(QCString((l[0]).data()));
+ m->setUrl(QCString((l[1]).data()));
return m;
}
-static Message *parseContactMessage(const QCString &str)
+static Message *parseContactMessage(const QString &str)
{
- QValueList<QCString> l;
+ QValueList<QString> l;
if (!parseFE(str, l, 2)){
log(L_WARN, "Parse error contacts message");
return NULL;
@@ -263,15 +263,15 @@
log(L_WARN, "No contacts found");
return NULL;
}
- QValueList<QCString> c;
+ QValueList<QString> c;
if (!parseFE(l[1], c, nContacts*2+1)){
log(L_WARN, "Parse error contacts message");
return NULL;
}
- QCString serverText;
+ QString serverText;
for (unsigned i = 0; i < nContacts; i++){
- QCString screen = c[i*2];
- QCString alias = c[i*2+1];
+ QString screen = c[i*2];
+ QString alias = c[i*2+1];
if (!serverText.isEmpty())
serverText += ';';
if (screen.toULong()){
@@ -307,64 +307,67 @@
}
}
IcqContactsMessage *m = new IcqContactsMessage;
- m->setServerText(serverText);
+ m->setServerText(QCString(serverText.data()));
return m;
}
-static Message *parseAuthRequest(const QCString &str)
+static Message *parseAuthRequest(const QString &str)
{
- QValueList<QCString> l;
+ QValueList<QString> l;
if (!parseFE(str, l, 6)){
log(L_WARN, "Parse error auth request message");
return NULL;
}
ICQAuthMessage *m = new ICQAuthMessage(MessageICQAuthRequest, MessageAuthRequest);
- m->setServerText(l[4]);
+ m->setServerText(QCString((l[4]).data()));
return m;
}
Message *ICQClient::parseExtendedMessage(const QString &screen, ICQBuffer &packet, MessageId &id, unsigned cookie)
{
- QCString header;
+ string header;
packet >> header;
- ICQBuffer h(header.size());
- h.pack(header, header.size());
- h.incReadPos(16);
+ ICQBuffer h(header.size());
+ //QString strheader(header);
+ h.pack(header.c_str(), header.size());
+ h.incReadPos(16);
unsigned short msg_type;
h >> msg_type;
- QCString msgType;
+ //QString msgType;
+ string msgType;
h.unpackStr32(msgType);
- QCString info;
+ //QString info;
+ string info;
packet.unpackStr32(info);
- ICQBuffer b(info.size());
- b.pack(info, info.size());
+ ICQBuffer b(info.size());
+ b.pack(info.c_str(), info.size());
- log(L_DEBUG, "Extended message %s [%04X] %u", msgType.data(), msg_type, info.size());
+ log(L_DEBUG, "Extended message %s [%04X] %u", msgType.data(), msg_type, info.length());
int n = msgType.find("URL");
if (n >= 0){
- QCString info;
+ QString info;
b.unpackStr32(info);
return parseURLMessage(info);
}
if (msgType == "Request For Contacts"){
- QCString info;
+ QString info;
b.unpackStr32(info);
ICQAuthMessage *m = new ICQAuthMessage(MessageContactRequest, MessageContactRequest);
- m->setServerText(info);
+ m->setServerText(QCString(info.data()));
return m;
}
if (msgType == "Contacts"){
- QCString p;
+ QString p;
b.unpackStr32(p);
return parseContactMessage(p);
}
if (msgType == "Message"){
- QCString p;
+ QString p;
b.unpackStr32(p);
unsigned long forecolor, backcolor;
b >> forecolor >> backcolor;
- QCString cap_str;
+ QString cap_str;
b.unpackStr32(cap_str);
Contact *contact;
ICQUserData *data = findContact(screen, NULL, false, contact);
@@ -386,7 +389,7 @@
}
n = msgType.find("File");
if (n >= 0){
- QCString fileDescr, fileName;
+ string fileDescr, fileName;
b.unpackStr32(fileDescr);
unsigned short port;
b >> port;
@@ -396,7 +399,7 @@
b.unpack(fileSize);
ICQFileMessage *m = new ICQFileMessage;
m->setServerDescr(fileName);
- m->setServerText(fileDescr);
+ m->setServerText(QCString(fileDescr.data()));
m->setSize(fileSize);
m->setPort(port);
m->setFlags(MESSAGE_TEMP);
@@ -408,8 +411,8 @@
}
if (msgType == "ICQSMS"){
string p;
- b.unpackStr32(info);
- p = info; // FIXME!!
+ b.unpackStr32(p);
+ //p = QCString(info).data(); // FIXME!!
string::iterator s = p.begin();
auto_ptr<XmlNode> top(XmlNode::parse(s, p.end()));
if (top.get() == NULL){
@@ -455,20 +458,20 @@
return NULL;
}
-Message *ICQClient::parseMessage(unsigned short type, const QString &screen, const QCString &p, ICQBuffer &packet, MessageId &id, unsigned cookie)
+Message *ICQClient::parseMessage(unsigned short type, const QString &screen, const QString &p, ICQBuffer &packet, MessageId &id, unsigned cookie)
{
if (screen.toULong() == 0x0A){
- QValueList<QCString> l;
+ QValueList<QString> l;
if (!parseFE(p, l, 6)){
log(L_WARN, "Parse error web panel message");
return NULL;
}
char SENDER_IP[] = "Sender IP:";
- QCString head = l[5].left(strlen(SENDER_IP));
+ QString head = l[5].left(strlen(SENDER_IP));
Message *msg = new Message((head == SENDER_IP) ? MessageWebPanel : MessageEmailPager);
- QString name = getContacts()->toUnicode(NULL, l[0]);
- QString mail = getContacts()->toUnicode(NULL, l[3]);
- msg->setServerText(l[5]);
+ QString name = getContacts()->toUnicode(NULL, QCString((l[0]).data()));
+ QString mail = getContacts()->toUnicode(NULL, QCString((l[3]).data()));
+ msg->setServerText(QCString((l[5]).data()));
Contact *contact = getContacts()->contactByMail(mail, name);
if (contact == NULL){
delete msg;
@@ -483,7 +486,7 @@
case ICQ_MSGxMSG:{
unsigned long forecolor, backcolor;
packet >> forecolor >> backcolor;
- QCString cap_str;
+ QString cap_str;
packet.unpackStr32(cap_str);
Contact *contact;
ICQUserData *data = findContact(screen, NULL, false, contact);
@@ -523,10 +526,10 @@
break;
case ICQ_MSGxFILE:{
ICQFileMessage *m = new ICQFileMessage;
- m->setServerText(p);
+ m->setServerText(QCString(p.data()));
unsigned short port;
unsigned long fileSize;
- QCString fileName;
+ QString fileName;
packet >> port;
packet.incReadPos(2);
packet >> fileName;
@@ -994,7 +997,7 @@
void ICQClient::packMessage(ICQBuffer &b, Message *msg, ICQUserData *data, unsigned short &type, bool bDirect, unsigned short flags)
{
ICQBuffer msgBuf, buf;
- QCString res;
+ QString res;
switch (msg->type()){
case MessageUrl:
res = getContacts()->fromUnicode(getContact(data), msg->getPlainText());
@@ -1067,9 +1070,9 @@
unsigned short type;
b >> type;
b.incReadPos(bDirect ? 1 : 4);
- QValueList<QCString> phonebook;
- QValueList<QCString> numbers;
- QValueList<QCString> phonedescr;
+ QValueList<QString> phonebook;
+ QValueList<QString> numbers;
+ QValueList<QString> phonedescr;
Contact *contact = NULL;
unsigned long state, time, size, nEntries;
unsigned i;
@@ -1087,7 +1090,7 @@
data->PluginStatusTime.toULong(), size, nEntries, plugin_type);
switch (plugin_type){
case PLUGIN_RANDOMxCHAT:{
- QCString name, topic, homepage;
+ QString name, topic, homepage;
b.incReadPos(-12);
b.unpackStr(name);
@@ -1136,7 +1139,7 @@
plugin p;
b.unpack((char*)p, sizeof(p));
b.incReadPos(4);
- QCString name, descr;
+ QString name, descr;
b.unpackStr32(name);
b.unpackStr32(descr);
b.incReadPos(4);
@@ -1183,7 +1186,7 @@
case PLUGIN_PICTURE:
if (data){
b.incReadPos(-4);
- QCString pict;
+ QString pict;
QByteArray ba;
b.unpackStr32(pict);
b.unpackStr32(ba);
@@ -1210,7 +1213,7 @@
break;
}
for (i = 0; i < nEntries; i++){
- QCString descr, area, phone, ext, country;
+ QString descr, area, phone, ext, country;
unsigned long active;
b.unpackStr32(descr);
b.unpackStr32(area);
@@ -1218,7 +1221,7 @@
b.unpackStr32(ext);
b.unpackStr32(country);
numbers.push_back(phone);
- QCString value;
+ QString value;
for (const ext_info *e = getCountries(); e->szName; e++){
if (country == e->szName){
value = "+";
@@ -1248,8 +1251,8 @@
}
for (i = 0; i < nEntries; i++){
unsigned long type;
- QCString phone = phonebook[i];
- QCString gateway;
+ QString phone = phonebook[i];
+ QString gateway;
b.incReadPos(4);
b.unpack(type);
b.unpackStr32(gateway);
@@ -1573,3 +1576,4 @@
+
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/icqservice.cpp
^
|
@@ -260,7 +260,7 @@
break;
}
if(!img.save(&buf, "JPEG")) {
- log(L_ERROR, "Can't save QImage to QBuffer");
+ log(L_ERROR, "Can't save QImage to QString");
break;
}
buf.close();
@@ -388,7 +388,7 @@
return;
}
unsigned short port = getPort();
- QCString addr(tlv_addr->byteArray());
+ QString addr(tlv_addr->byteArray());
int idx = addr.find(':');
if(idx != -1) {
port = addr.mid(idx + 1).toUShort();
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/icqssbi.cpp
^
|
@@ -298,7 +298,7 @@
return;
}
if(!img.save(&buf, "JPEG")) {
- log(L_ERROR, "Can't save QImage to QBuffer");
+ log(L_ERROR, "Can't save QImage to QString");
return;
}
buf.close();
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/icqvarious.cpp
^
|
@@ -233,7 +233,7 @@
unsigned char type, flag;
struct tm sendTM;
memset(&sendTM, 0, sizeof(sendTM));
- QCString message;
+ QString message;
unsigned short year;
unsigned char month, day, hours, min;
msg.unpack(uin);
@@ -389,14 +389,14 @@
for (; n > 0; n--){
unsigned short c;
b.unpack(c);
- QCString s;
+ QString s;
b >> s;
if (c == 0) continue;
if (res.length())
res += ';';
res += QString::number(c);
res += ',';
- res += quoteChars(getContacts()->toUnicode(contact, s), ";");
+ res += quoteChars(getContacts()->toUnicode(contact, QCString(s.data())), ";");
}
return res;
}
@@ -423,8 +423,8 @@
char webAware;
char allowDC;
char hideEmail;
- QCString Nick, FirstName, LastName, EMail, City, State;
- QCString HomePhone, HomeFax, Address, PrivateCellular, Zip;
+ QString Nick, FirstName, LastName, EMail, City, State;
+ QString HomePhone, HomeFax, Address, PrivateCellular, Zip;
b
>> Nick
>> FirstName
@@ -438,17 +438,17 @@
>> PrivateCellular
>> Zip;
- data->Nick.str() = getContacts()->toUnicode(contact, Nick);
- data->FirstName.str() = getContacts()->toUnicode(contact, FirstName);
- data->LastName.str() = getContacts()->toUnicode(contact, LastName);
- data->EMail.str() = getContacts()->toUnicode(contact, EMail);
- data->City.str() = getContacts()->toUnicode(contact, City);
- data->State.str() = getContacts()->toUnicode(contact, State);
- data->HomePhone.str() = getContacts()->toUnicode(contact, HomePhone);
- data->HomeFax.str() = getContacts()->toUnicode(contact, HomeFax);
- data->Address.str() = getContacts()->toUnicode(contact, Address);
- data->PrivateCellular.str() = getContacts()->toUnicode(contact, PrivateCellular);
- data->Zip.str() = getContacts()->toUnicode(contact, Zip);
+ data->Nick.str() = getContacts()->toUnicode(contact, QCString(Nick.data()));
+ data->FirstName.str() = getContacts()->toUnicode(contact, QCString(FirstName.data()));
+ data->LastName.str() = getContacts()->toUnicode(contact, QCString(LastName.data()));
+ data->EMail.str() = getContacts()->toUnicode(contact, QCString(EMail.data()));
+ data->City.str() = getContacts()->toUnicode(contact, QCString(City.data()));
+ data->State.str() = getContacts()->toUnicode(contact, QCString(State.data()));
+ data->HomePhone.str() = getContacts()->toUnicode(contact, QCString(HomePhone.data()));
+ data->HomeFax.str() = getContacts()->toUnicode(contact, QCString(HomeFax.data()));
+ data->Address.str() = getContacts()->toUnicode(contact, QCString(Address.data()));
+ data->PrivateCellular.str() = getContacts()->toUnicode(contact, QCString(PrivateCellular.data()));
+ data->Zip.str() = getContacts()->toUnicode(contact, QCString(Zip.data()));
b.unpack(n);
data->Country.asULong() = n;
@@ -466,14 +466,14 @@
}
case ICQ_SRVxMORE_INFO:{
char c;
- QCString Homepage;
+ QString Homepage;
b >> c;
data->Age.asULong() = c;
b >> c;
b >> c;
data->Gender.asULong() = c;
b >> Homepage;
- data->Homepage.str() = getContacts()->toUnicode(contact, Homepage);
+ data->Homepage.str() = getContacts()->toUnicode(contact, QCString(Homepage.data()));
unsigned short year;
b.unpack(year);
data->BirthYear.asULong() = year;
@@ -496,11 +496,11 @@
for (;c > 0;c--){
char d;
b >> d;
- QCString s;
+ QString s;
b >> s;
if (mail.length())
mail += ';';
- mail += quoteChars(getContacts()->toUnicode(contact, s), ";");
+ mail += quoteChars(getContacts()->toUnicode(contact, QCString(s.data())), ";");
mail += '/';
if (d)
mail += '-';
@@ -510,8 +510,8 @@
}
case ICQ_SRVxWORK_INFO:{
unsigned short n;
- QCString WorkCity, WorkState, WorkPhone, WorkFax, WorkAddress, WorkZip;
- QCString WorkName, WorkDepartment, WorkPosition, WorkHomepage;
+ QString WorkCity, WorkState, WorkPhone, WorkFax, WorkAddress, WorkZip;
+ QString WorkName, WorkDepartment, WorkPosition, WorkHomepage;
b
>> WorkCity
>> WorkState
@@ -519,12 +519,12 @@
>> WorkFax
>> WorkAddress
>> WorkZip;
- data->WorkCity.str() = getContacts()->toUnicode(contact, WorkCity);
- data->WorkState.str() = getContacts()->toUnicode(contact, WorkState);
- data->WorkPhone.str() = getContacts()->toUnicode(contact, WorkPhone);
- data->WorkFax.str() = getContacts()->toUnicode(contact, WorkFax);
- data->WorkAddress.str() = getContacts()->toUnicode(contact, WorkAddress);
- data->WorkZip.str() = getContacts()->toUnicode(contact, WorkZip);
+ data->WorkCity.str() = getContacts()->toUnicode(contact, QCString(WorkCity.data()));
+ data->WorkState.str() = getContacts()->toUnicode(contact, QCString(WorkState.data()));
+ data->WorkPhone.str() = getContacts()->toUnicode(contact, QCString(WorkPhone.data()));
+ data->WorkFax.str() = getContacts()->toUnicode(contact, QCString(WorkFax.data()));
+ data->WorkAddress.str() = getContacts()->toUnicode(contact, QCString(WorkAddress.data()));
+ data->WorkZip.str() = getContacts()->toUnicode(contact, QCString(WorkZip.data()));
b.unpack(n);
data->WorkCountry.asULong() = n;
@@ -532,20 +532,20 @@
>> WorkName
>> WorkDepartment
>> WorkPosition;
- data->WorkName.str() = getContacts()->toUnicode(contact, WorkName);
- data->WorkDepartment.str() = getContacts()->toUnicode(contact, WorkDepartment);
- data->WorkPosition.str() = getContacts()->toUnicode(contact, WorkPosition);
+ data->WorkName.str() = getContacts()->toUnicode(contact, QCString(WorkName.data()));
+ data->WorkDepartment.str() = getContacts()->toUnicode(contact, QCString(WorkDepartment.data()));
+ data->WorkPosition.str() = getContacts()->toUnicode(contact, QCString(WorkPosition.data()));
b.unpack(n);
data->Occupation.asULong() = n;
b >> WorkHomepage;
- data->WorkHomepage.str() = getContacts()->toUnicode(contact, WorkHomepage);
+ data->WorkHomepage.str() = getContacts()->toUnicode(contact, QCString(WorkHomepage.data()));
break;
}
case ICQ_SRVxABOUT_INFO: {
- QCString About;
+ QString About;
b >> About;
- data->About.str() = getContacts()->toUnicode(contact, About);
+ data->About.str() = getContacts()->toUnicode(contact, QCString(About.data()));
break;
}
case ICQ_SRVxINTERESTS_INFO:
@@ -689,7 +689,7 @@
bool SearchWPRequest::answer(ICQBuffer &b, unsigned short nSubType)
{
- QCString Nick, FirstName, LastName, EMail;
+ QString Nick, FirstName, LastName, EMail;
SearchResult res;
res.id = m_id;
res.client = m_client;
@@ -708,10 +708,10 @@
>> LastName
>> EMail
>> waitAuth;
- res.data.Nick.str() = getContacts()->toUnicode(NULL, Nick);
- res.data.FirstName.str() = getContacts()->toUnicode(NULL, FirstName);
- res.data.LastName.str() = getContacts()->toUnicode(NULL, LastName);
- res.data.EMail.str() = getContacts()->toUnicode(NULL, EMail);
+ res.data.Nick.str() = getContacts()->toUnicode(NULL, QCString(Nick.data()));
+ res.data.FirstName.str() = getContacts()->toUnicode(NULL, QCString(FirstName.data()));
+ res.data.LastName.str() = getContacts()->toUnicode(NULL, QCString(LastName.data()));
+ res.data.EMail.str() = getContacts()->toUnicode(NULL, QCString(EMail.data()));
b.unpack(state);
b >> gender;
@@ -767,7 +767,7 @@
{
if (getState() != Connected)
return (unsigned short)~0U;
- QCString mail = getContacts()->fromUnicode(NULL, _mail);
+ QString mail = getContacts()->fromUnicode(NULL, _mail);
serverRequest(ICQ_SRVxREQ_MORE);
socket()->writeBuffer()
@@ -782,7 +782,7 @@
{
if ((code == 0) && _keywords.isEmpty())
return;
- QCString data = getContacts()->fromUnicode(NULL, _keywords);
+ QString data = getContacts()->fromUnicode(NULL, _keywords);
ICQBuffer b;
b.pack(code);
@@ -794,7 +794,7 @@
{
if(_data.isEmpty())
return;
- QCString data = getContacts()->fromUnicode(NULL, _data);
+ QString data = getContacts()->fromUnicode(NULL, _data);
socket()->writeBuffer().tlvLE(tlv, data);
}
@@ -949,7 +949,7 @@
// ******************************************
static Tlv makeSString(unsigned id, const QString &str)
{
- QCString cstr = getContacts()->fromUnicode(NULL, str);
+ QString cstr = getContacts()->fromUnicode(NULL, str);
unsigned len = cstr.length() + 1; // including '\0'
QByteArray ba( len + 2 );
ba[0] = (char)((len ) & 0xff);
@@ -971,7 +971,7 @@
static Tlv makeECombo(unsigned id, const QString &str)
{
- QCString cstr = getContacts()->fromUnicode(NULL, str);
+ QString cstr = getContacts()->fromUnicode(NULL, str);
unsigned len = cstr.length() + 1; // including '\0'
QByteArray ba( len + 3 );
ba[0] = (char)((len ) & 0xff);
@@ -987,7 +987,7 @@
if ( str.isEmpty() )
return list;
- QCString cstr = getContacts()->fromUnicode(NULL, str);
+ QString cstr = getContacts()->fromUnicode(NULL, str);
int cur = 0;
int idx = 0;
do {
@@ -1002,7 +1002,7 @@
if( idx == -1 )
idx = cstr.length();
- QCString data = cstr.mid( cur, idx - cur);
+ QString data = cstr.mid( cur, idx - cur);
cur = idx + 1;
int len = data.length();
@@ -1069,7 +1069,8 @@
unsigned len;
const unsigned char *data = (const unsigned char*)tlvData;
len = data[0] | ( data[1] << 8 );
- QString ret = getContacts()->toUnicode(NULL, QCString( &tlvData[2], len));
+ QCString tmp( &tlvData[2], len);
+ QString ret = getContacts()->toUnicode(NULL, tmp);
return ret;
}
@@ -1529,7 +1530,7 @@
if (code == 0x0100){
if (m_client->smsQueue.empty())
return true;
- QCString errStr = b.data(b.readPos());
+ QString errStr = b.data(b.readPos());
SendMsg &s = m_client->smsQueue.front();
SMSMessage *sms = static_cast<SMSMessage*>(s.msg);
m_client->smsQueue.erase(m_client->smsQueue.begin());
@@ -1538,12 +1539,12 @@
delete sms;
}else{
b.incReadPos(6);
- QCString provider;
- QCString answer_QCString;
+ QString provider;
+ QString answer_QString;
b.unpackStr(provider);
- b.unpackStr(answer_QCString);
+ b.unpackStr(answer_QString);
// FIXME
- std::string answer = (const char *)answer_QCString;
+ std::string answer = (const char *)answer_QString;
string::iterator s = answer.begin();
auto_ptr<XmlNode> top(XmlNode::parse(s, answer.end()));
QString error = I18N_NOOP("SMS send fail");
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/moreinfo.cpp
^
|
@@ -163,10 +163,14 @@
initCombo(cmbGender, data->Gender.toULong(), genders);
if (spnAge->text() == "0")
spnAge->setSpecialValueText(QString::null);
- QDate date;
- date.setYMD(data->BirthYear.toULong(), data->BirthMonth.toULong(), data->BirthDay.toULong());
- edtDate->setDate(date);
- birthDayChanged();
+
+ if (data->BirthYear.toULong()>0 && data->BirthMonth.toULong()>0 && data->BirthDay.toULong()>0) {
+ QDate date;
+ date.setYMD(data->BirthYear.toULong(), data->BirthMonth.toULong(), data->BirthDay.toULong());
+ edtDate->setDate(date);
+ birthDayChanged();
+ }
+
unsigned l = data->Language.toULong();
char l1 = (char)(l & 0xFF);
l = l >> 8;
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/rtf.ll
^
|
@@ -136,7 +136,7 @@
void reset();
void resetTag(TagEnum tag);
protected:
- QCString text;
+ QString text;
void Init();
RTF2HTML *p;
void resetColors() { m_nRed = m_nGreen = m_nBlue = 0; m_bColorInit = false; }
@@ -1028,7 +1028,7 @@
return s;
}
-bool ICQClient::parseRTF(const QCString &rtf, Contact *contact, QString &res)
+bool ICQClient::parseRTF(const QString &rtf, Contact *contact, QString &res)
{
const char _RTF[] = "{\\rtf";
// codec to use when no other information is in the rtf stream
@@ -1042,3 +1042,4 @@
return false;
}
+
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/icq/rtfgen.cpp
^
|
@@ -224,7 +224,7 @@
{
public:
RTFGenParser(ICQClient *client, const QColor& foreColor, Contact *contact, unsigned max_size);
- QCString parse(const QString &text);
+ QString parse(const QString &text);
// Returns the color's index in the colors table, adding the color if necessary.
int getColorIdx(const QColor &color);
// Returns the font face's index in the fonts table, adding the font face if necessary.
@@ -237,7 +237,7 @@
virtual void text(const QString &text);
virtual void tag_start(const QString &tag, const list<QString> &attrs);
virtual void tag_end(const QString &tag);
- QCString res;
+ QString res;
ICQClient *m_client;
Contact *m_contact;
QTextCodec *m_codec;
@@ -325,7 +325,7 @@
return m_fontFaces.size() - 1;
}
-QCString RTFGenParser::parse(const QString &text)
+QString RTFGenParser::parse(const QString &text)
{
res = QString::null;
m_res_size = 0;
@@ -381,7 +381,7 @@
m_bSpace = true;
HTMLParser::parse(text);
- QCString s;
+ QString s;
s = "{\\rtf1\\ansi";
if (ansicpg){
s += "\\ansicpg";
@@ -848,10 +848,10 @@
}
}
-QCString ICQClient::createRTF(QString &text, QString &part, unsigned long foreColor, Contact *contact, unsigned max_size)
+QString ICQClient::createRTF(QString &text, QString &part, unsigned long foreColor, Contact *contact, unsigned max_size)
{
RTFGenParser p(this, foreColor, contact, max_size);
- QCString res = p.parse(text);
+ QString res = p.parse(text);
if (p.m_res_size == 0){
part = text;
text = QString::null;
@@ -883,7 +883,7 @@
virtual void tag_end(const QString &tag);
void startBody();
void endBody();
- QCString res;
+ QString res;
bool m_bBody;
bool m_bIcq;
};
@@ -1107,3 +1107,4 @@
}
+
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/jabber/jabber.cpp
^
|
@@ -139,6 +139,21 @@
NULL,
QString::null
),
+ CommandDef (
+ STATUS_OCCUPIED,
+ I18N_NOOP("Occupied"),
+ "Jabber_occupied",
+ QString::null,
+ QString::null,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ NULL,
+ QString::null
+ ),
CommandDef (
STATUS_FFC,
I18N_NOOP("Free for chat"),
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/jabber/jabber_rosters.cpp
^
|
@@ -806,6 +806,8 @@
status = STATUS_NA;
}else if (m_show == "dnd"){
status = STATUS_DND;
+ }else if (m_show == "occupied"){
+ status = STATUS_OCCUPIED;
}else if (m_show == "online"){
status = STATUS_ONLINE;
}else if (m_show.isEmpty()){
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/jabber/jabberclient.cpp
^
|
@@ -572,6 +572,9 @@
case STATUS_DND:
show = "dnd";
break;
+ case STATUS_OCCUPIED:
+ show = "occupied";
+ break;
case STATUS_FFC:
show = "chat";
break;
@@ -1074,6 +1077,9 @@
case STATUS_DND:
dicon = "ICQ_dnd";
break;
+ case STATUS_OCCUPIED:
+ dicon = "ICQ_occupied";
+ break;
case STATUS_FFC:
dicon = "ICQ_ffc";
break;
@@ -1111,6 +1117,9 @@
case STATUS_DND:
dicon = "MSN_dnd";
break;
+ case STATUS_OCCUPIED:
+ dicon = "MSN_occupied";
+ break;
}
}
}else if (h == "yahoo"){
@@ -1130,6 +1139,9 @@
case STATUS_DND:
dicon = "Yahoo!_dnd";
break;
+ case STATUS_OCCUPIED:
+ dicon = "Yahoo!_occupied";
+ break;
case STATUS_FFC:
dicon = "Yahoo!_ffc";
break;
@@ -1151,6 +1163,9 @@
case STATUS_DND:
dicon = "sms_dnd";
break;
+ case STATUS_OCCUPIED:
+ dicon = "sms_occupied";
+ break;
case STATUS_FFC:
dicon = "sms_ffc";
break;
@@ -1172,6 +1187,9 @@
case STATUS_DND:
dicon = "GG_dnd";
break;
+ case STATUS_OCCUPIED:
+ dicon = "GG_occupied";
+ break;
case STATUS_FFC:
dicon = "GG_ffc";
break;
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/navigate/navigate.cpp
^
|
@@ -31,6 +31,7 @@
using namespace SIM;
#ifdef WIN32
+#include <qprocess.h>
#include <windows.h>
#include <ddeml.h>
@@ -446,8 +447,15 @@
if (!bExec){
if (proto == "file")
url = url.mid(5);
- ShellExecute(NULL, NULL, (LPCWSTR)url.ucs2(), NULL, NULL, SW_SHOWNORMAL);
- }
+ //ShellExecuteA(NULL, NULL, url.c_str(), NULL, NULL, SW_SHOWNORMAL); //Fixme: Bug, does not work
+ QProcess openPathInExplorer;
+ QString path(url);
+ path.replace("%20", " ");
+ openPathInExplorer.addArgument("explorer");
+ openPathInExplorer.addArgument(path);
+ if (openPathInExplorer.start()) qDebug(i18n("Explorer started for Path"));
+ else qDebug(i18n("ERR: Explorer started for Path FAILED!"));
+ }
#else
#ifdef USE_KDE
if (getUseKDE())
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/netmonitor/Makefile.am
^
|
@@ -4,7 +4,7 @@
netmonitor.cpp \
monitor.cpp
-INCLUDES=-I$(srcdir)/../../sim $(all_includes)
+INCLUDES=$(LTDLINCL) -I$(srcdir)/../../sim -I. -I../../plugins/_core $(all_includes)
netmonitor_la_METASOURCES = AUTO
netmonitor_la_LIBADD = ../../sim/libsim.la $(LIBUI) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KFILE) $(LIB_QT) $(EXTRA_LIBS)
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/netmonitor/Makefile.in
^
|
@@ -399,7 +399,7 @@
netmonitor.cpp \
monitor.cpp
-INCLUDES = -I$(srcdir)/../../sim $(all_includes)
+INCLUDES = $(LTDLINCL) -I$(srcdir)/../../sim -I. -I../../plugins/_core $(all_includes)
#>- netmonitor_la_METASOURCES = AUTO
netmonitor_la_LIBADD = ../../sim/libsim.la $(LIBUI) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KFILE) $(LIB_QT) $(EXTRA_LIBS)
#>- netmonitor_la_LDFLAGS = -module -no-undefined -avoid-version -L../../sim/.libs $(QT_LDFLAGS) $(KDE_RPATH) $(all_libraries)
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/osd/osd.cpp
^
|
@@ -42,14 +42,30 @@
#include "osdconfig.h"
+
+
#ifdef WIN32
#include <windows.h>
+ #include <qlibrary.h>
#ifndef CS_DROPSHADOW
#define CS_DROPSHADOW 0x00020000
#endif
#ifndef SPI_GETSCREENSAVERRUNNING
#define SPI_GETSCREENSAVERRUNNING 114
#endif
+
+ #define SHOW_TIMEOUT 300
+ #define HIDE_TIMEOUT 1000
+
+ typedef BOOL(WINAPI *slwa_ptr)(HWND, COLORREF, BYTE, DWORD);
+ static slwa_ptr slwa = NULL;
+
+ #if _WIN32_WINNT < 0x0500
+ #define WS_EX_LAYERED 0x00080000
+ #define LWA_COLORKEY 0x00000001
+ #define LWA_ALPHA 0x00000002
+ #endif
+
#else
/*#include <stdio.h>
#include <fcntl.h>
@@ -116,6 +132,7 @@
{ "Font", DATA_STRING, 1, 0 },
{ "Timeout", DATA_ULONG, 1, DATA(7) },
{ "Shadow", DATA_BOOL, 1, DATA(1) },
+ { "Fading", DATA_BOOL, 1, DATA(1) },
{ "Background", DATA_BOOL, 1, 0 },
{ "BgColor", DATA_ULONG, 1, 0 },
{ "Screen", DATA_ULONG, 1, 0 },
@@ -172,9 +189,27 @@
void OSDPlugin::timeout()
{
- m_osd->hide();
+#ifdef WIN32
+ Contact *contact = getContacts()->contact(m_request.contact);
+ if (!contact) return; //avoid crash
+ OSDUserData *data = (OSDUserData*)contact->getUserData(user_data_id);
+ if (data->Fading.toBool()){
+ transOutCounter=0;
+ m_transTimer = new QTimer(this);
+ connect(m_transTimer, SIGNAL(timeout()), this, SLOT(m_transTimerFadeOutTimeout()));
+ SetWindowLongW(m_osd->winId(), GWL_EXSTYLE, GetWindowLongW(m_osd->winId(), GWL_EXSTYLE) | WS_EX_LAYERED);
+ m_transTimer->start(5);
+ }
+ else
+ m_osd->hide();
+
m_timer->stop();
processQueue();
+#else
+ m_osd->hide();
+ m_timer->stop();
+ processQueue();
+#endif
}
QFont OSDPlugin::getBaseFont(QFont font)
@@ -382,10 +417,70 @@
p.drawText(rc, AlignLeft | AlignTop | WordBreak, str);
p.end();
bgPict = pict;
- QWidget::show();
+#ifdef WIN32
+ //SetWindowLongW(this->winId(), GWL_EXSTYLE, GetWindowLongW(this->winId(), GWL_EXSTYLE) & (~WS_EX_LAYERED));
+ if (data->Fading.toBool()){
+ slwa = (slwa_ptr)QLibrary::resolve("user32.dll","SetLayeredWindowAttributes");
+ if (slwa == NULL)
+ return;
+ transCounter=100;
+ SetWindowLongW(this->winId(), GWL_EXSTYLE, GetWindowLongW(this->winId(), GWL_EXSTYLE) | WS_EX_LAYERED);
+ BYTE d = (BYTE) QMIN((100 - transCounter) * 256 / 100, 255);
+ slwa(this->winId(), this->colorGroup().background().rgb(), d, LWA_ALPHA);
+ RedrawWindow(this->winId(), NULL, NULL, RDW_UPDATENOW);
+ m_transTimer = new QTimer(this);
+ }
+ QWidget::show();
+ raise();
+ if (data->Fading.toBool()){
+ connect(m_transTimer, SIGNAL(timeout()), this, SLOT(m_transTimerFadeInTimeout()));
+ m_transTimer->start(5);
+ }
+#else
+ QWidget::show();
raise();
+#endif
+}
+
+void OSDWidget::m_transTimerFadeInTimeout(){
+#ifdef WIN32
+ slwa = (slwa_ptr)QLibrary::resolve("user32.dll","SetLayeredWindowAttributes");
+ if (slwa == NULL)
+ return;
+ BYTE d = (BYTE) QMIN((100 - transCounter) * 256 / 100, 255);
+ slwa(this->winId(), this->colorGroup().background().rgb(), d, LWA_ALPHA);
+ RedrawWindow(this->winId(), NULL, NULL, RDW_UPDATENOW);
+ transCounter-=5;
+ if (transCounter==0) {
+ m_transTimer->stop();
+ disconnect(m_transTimer, SIGNAL(timeout()), this, SLOT(m_transTimerFadeInTimeout()));
+ SetWindowLongW(this->winId(), GWL_EXSTYLE, GetWindowLongW(this->winId(), GWL_EXSTYLE) & (~WS_EX_LAYERED));
+ }
+#endif
+}
+
+void OSDPlugin::m_transTimerFadeOutTimeout(){
+#ifdef WIN32
+ slwa = (slwa_ptr)QLibrary::resolve("user32.dll","SetLayeredWindowAttributes");
+ if (slwa == NULL)
+ return;
+
+ //SetWindowLongW(m_osd->winId(), GWL_EXSTYLE, GetWindowLongW(m_osd->winId(), GWL_EXSTYLE) | WS_EX_LAYERED);
+ BYTE d = (BYTE) QMIN((100 - transOutCounter) * 256 / 100, 255);
+ slwa(m_osd->winId(), m_osd->colorGroup().background().rgb(), d, LWA_ALPHA);
+ RedrawWindow(m_osd->winId(), NULL, NULL, RDW_UPDATENOW);
+ transOutCounter+=5;
+ if (transOutCounter==100){
+ m_osd->hide();
+ m_transTimer->stop();
+ disconnect(m_transTimer, SIGNAL(timeout()), this, SLOT(m_transTimerFadeOutTimeout()));
+ SetWindowLongW(m_osd->winId(), GWL_EXSTYLE, GetWindowLongW(m_osd->winId(), GWL_EXSTYLE) & (~WS_EX_LAYERED));
+ }
+#endif
}
+
+
void OSDWidget::paintEvent(QPaintEvent*)
{
QPainter p(this);
@@ -438,6 +533,7 @@
QString text;
OSDUserData *data = NULL;
data = (OSDUserData*)contact->getUserData(user_data_id);
+ uint ms=core->getManualStatus();
switch (m_request.type){
case OSD_ALERTONLINE:
if (data->EnableAlert.toBool() && data->EnableAlertOnline.toBool()){
@@ -473,7 +569,7 @@
}
break;
case OSD_ALERTOFFLINE:
- if (data->EnableAlert.toBool() && data->EnableAlertOffline.toBool() && !(core->getManualStatus() == STATUS_OFFLINE)){
+ if (data->EnableAlert.toBool() && data->EnableAlertOffline.toBool() && (ms-1) ){
text = g_i18n("%1 is offline", contact) .arg(contact->getName());
}
break;
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/osd/osd.h
^
|
@@ -65,6 +65,7 @@
SIM::Data Font;
SIM::Data Timeout;
SIM::Data Shadow;
+ SIM::Data Fading;
SIM::Data Background;
SIM::Data BgColor;
SIM::Data Screen;
@@ -106,6 +107,8 @@
void closeClick();
protected slots:
void slotCloseClick();
+ void m_transTimerFadeInTimeout();
+
protected:
bool isScreenSaverActive();
void paintEvent(QPaintEvent*);
@@ -113,7 +116,9 @@
QFont baseFont;
QPixmap bgPict;
QPushButton *m_button;
- OSDPlugin *m_plugin;
+ OSDPlugin *m_plugin;
+ QTimer *m_transTimer;
+ uint transCounter;
};
class OSDPlugin : public QObject, public SIM::Plugin, public SIM::EventReceiver, public QThread
@@ -126,6 +131,7 @@
unsigned long user_data_id;
protected slots:
void timeout();
+ void m_transTimerFadeOutTimeout();
void dblClick();
void closeClick();
protected:
@@ -141,6 +147,8 @@
QWidget *m_osd;
QTimer *m_timer;
bool bCapsState;
+ QTimer *m_transTimer;
+ uint transOutCounter;
bool bHaveUnreadMessages; // Should use this flag in OSDPlugin::run instead of core->unread.size()
// see pacth #2304 for more info.
};
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/osd/osdiface.cpp
^
|
@@ -34,6 +34,10 @@
{
m_plugin = plugin;
OSDUserData *data = (OSDUserData*)d;
+#ifndef WIN32
+ chkFading->setChecked(false);
+ chkFading->hide();
+#endif
cmbPos->insertItem(i18n("Left-bottom"));
cmbPos->insertItem(i18n("Left-top"));
cmbPos->insertItem(i18n("Right-bottom"));
@@ -55,6 +59,7 @@
edtFont->setFont(data->Font.str());
}
chkShadow->setChecked(data->Shadow.toBool());
+ chkFading->setChecked(data->Fading.toBool());
if (data->Background.toBool()){
chkBackground->setChecked(true);
btnBgColor->setColor(data->BgColor.toULong());
@@ -100,6 +105,7 @@
f = "";
data->Font.str() = f;
data->Shadow.asBool() = chkShadow->isChecked();
+ data->Fading.asBool() = chkFading->isChecked();
data->Background.asBool() = chkBackground->isChecked();
if (data->Background.toBool()){
data->BgColor.asULong() = btnBgColor->color().rgb();
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/osd/osdifacebase.ui
^
|
@@ -149,7 +149,7 @@
</size>
</property>
</spacer>
- <widget row="6" column="0" rowspan="1" colspan="3" >
+ <widget row="6" column="0" rowspan="1" colspan="1" >
<class>QCheckBox</class>
<property stdset="1">
<name>name</name>
@@ -160,6 +160,17 @@
<string>Show sha&dow</string>
</property>
</widget>
+ <widget row="6" column="1" rowspan="1" colspan="2" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>chkFading</cstring>
+ </property>
+ <property>
+ <name>text</name>
+ <string>Show F&ading</string>
+ </property>
+ </widget>
<widget row="7" column="0" rowspan="1" colspan="3" >
<class>QCheckBox</class>
<property stdset="1">
|
|
Changed |
sim-0.9.5.tar.bz2/plugins/sound/sounds/contactrequest.ogg
^
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/transparent/transparent.cpp
^
|
@@ -90,7 +90,9 @@
{
{ "Transparency", DATA_ULONG, 1, DATA(60) },
#ifdef WIN32
- { "IfInactive", DATA_BOOL, 1, DATA(1) },
+ { "IfInactive", DATA_BOOL, 1, DATA(1) },
+ { "IfMainWindow", DATA_BOOL, 1, DATA(1) },
+ { "IfFloatings", DATA_BOOL, 1, DATA(1) },
#endif
{ NULL, DATA_UNKNOWN, 0, 0 }
};
@@ -134,10 +136,11 @@
delete timer;
//Handle Floatings
+
QWidgetList *list = QApplication::topLevelWidgets();
QWidgetListIt it(*list);
- QWidget * w;
- while ((w = it.current()) != NULL) {
+ QWidget * w;
+ while ((w = it.current()) != NULL) {
if (w->inherits("FloatyWnd")){
FloatyWnd *refwnd = static_cast<FloatyWnd*>(w);
SetWindowLongW(refwnd->winId(), GWL_EXSTYLE, GetWindowLongW(refwnd->winId(), GWL_EXSTYLE) & (~WS_EX_LAYERED));
@@ -188,6 +191,24 @@
if (main->frameGeometry().contains(p))
bMouse = true;
}
+
+
+ //Handle Floatings//
+ QWidgetList *list = QApplication::topLevelWidgets();
+ QWidgetListIt it(*list);
+ QWidget * w;
+ while ((w = it.current()) != NULL) {
+ if (w->inherits("FloatyWnd")){
+ if (w->frameGeometry().contains(p))
+ bMouse = true;
+ }
+ ++it;
+ }
+ delete list; //Handle Floatings//
+
+
+
+
if (bMouse != m_bHaveMouse){
m_bHaveMouse = bMouse;
setState();
@@ -235,44 +256,69 @@
timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(tick()));
main->installEventFilter(this);
- SetWindowLongW(main->winId(), GWL_EXSTYLE, GetWindowLongW(main->winId(), GWL_EXSTYLE) | WS_EX_LAYERED);
- slwa(main->winId(), main->colorGroup().background().rgb(), 0, LWA_ALPHA);
- RedrawWindow(main->winId(), NULL, NULL, RDW_UPDATENOW);
+ if (getIfMainWindow()) {
+ SetWindowLongW(main->winId(), GWL_EXSTYLE, GetWindowLongW(main->winId(), GWL_EXSTYLE) | WS_EX_LAYERED);
+ slwa(main->winId(), main->colorGroup().background().rgb(), 0, LWA_ALPHA);
+ RedrawWindow(main->winId(), NULL, NULL, RDW_UPDATENOW);
+ }
+ else
+ SetWindowLongW(main->winId(), GWL_EXSTYLE, GetWindowLongW(main->winId(), GWL_EXSTYLE) & (~WS_EX_LAYERED));
+
main->setMouseTracking(true);
m_bActive = main->isActiveWindow();
m_bState = !m_bActive;
//Handle Floatings
- QWidgetListIt it(*list);
- QWidget * w;
- while ((w = it.current()) != NULL) {
- if (w->inherits("FloatyWnd")){
- FloatyWnd *refwnd = static_cast<FloatyWnd*>(w);
- refwnd->installEventFilter(this);
- SetWindowLongW(refwnd->winId(), GWL_EXSTYLE, GetWindowLongW(main->winId(), GWL_EXSTYLE) | WS_EX_LAYERED);
- slwa(refwnd->winId(), refwnd->colorGroup().background().rgb(), 0, LWA_ALPHA);
- RedrawWindow(refwnd->winId(), NULL, NULL, RDW_UPDATENOW);
+
+ QWidgetListIt it(*list);
+ QWidget * w;
+ while ((w = it.current()) != NULL) {
+ if (w->inherits("FloatyWnd")){
+ FloatyWnd *refwnd = static_cast<FloatyWnd*>(w);
+ refwnd->installEventFilter(this);
+ if (getIfFloatings()) {
+ SetWindowLongW(refwnd->winId(), GWL_EXSTYLE, GetWindowLongW(main->winId(), GWL_EXSTYLE) | WS_EX_LAYERED);
+ slwa(refwnd->winId(), refwnd->colorGroup().background().rgb(), 0, LWA_ALPHA);
+ RedrawWindow(refwnd->winId(), NULL, NULL, RDW_UPDATENOW);
+ }
+ else
+ SetWindowLongW(refwnd->winId(), GWL_EXSTYLE, GetWindowLongW(refwnd->winId(), GWL_EXSTYLE) & (~WS_EX_LAYERED));
+ }
+ ++it;
}
- ++it;
- }
- delete list; //Handle Floatings//
+ delete list; //Handle Floatings//
+
}
bool bNewState = m_bActive || m_bHaveMouse;
if (bNewState == m_bState){
- BYTE d = (BYTE)(bNewState ? 255 : QMIN((100 - getTransparency()) * 256 / 100, 255));
- slwa(main->winId(), main->colorGroup().background().rgb(), d, LWA_ALPHA);
+ BYTE d = (BYTE)(bNewState ? 255 : QMIN((100 - getTransparency()) * 256 / 100, 255));
+ if (getIfMainWindow()) {
+ SetWindowLongW(main->winId(), GWL_EXSTYLE, GetWindowLongW(main->winId(), GWL_EXSTYLE) | WS_EX_LAYERED);
+ slwa(main->winId(), main->colorGroup().background().rgb(), d, LWA_ALPHA);
+ RedrawWindow(main->winId(), NULL, NULL, RDW_UPDATENOW);
+ }
+ else
+ SetWindowLongW(main->winId(), GWL_EXSTYLE, GetWindowLongW(main->winId(), GWL_EXSTYLE) & (~WS_EX_LAYERED));
+
//Handle Floatings
QWidgetListIt it(*list);
- QWidget * w;
- while ((w = it.current()) != NULL) {
+ QWidget * w;
+ while ((w = it.current()) != NULL) {
if (w->inherits("FloatyWnd")){
FloatyWnd *refwnd = static_cast<FloatyWnd*>(w);
- slwa(refwnd->winId(), refwnd->colorGroup().background().rgb(), d, LWA_ALPHA);
+ refwnd->installEventFilter(this);
+ if (getIfFloatings()) {
+ SetWindowLongW(refwnd->winId(), GWL_EXSTYLE, GetWindowLongW(refwnd->winId(), GWL_EXSTYLE) | WS_EX_LAYERED);
+ slwa(refwnd->winId(), refwnd->colorGroup().background().rgb(), d, LWA_ALPHA);
+ RedrawWindow(refwnd->winId(), NULL, NULL, RDW_UPDATENOW);
+ }
+ else
+ SetWindowLongW(refwnd->winId(), GWL_EXSTYLE, GetWindowLongW(refwnd->winId(), GWL_EXSTYLE) & (~WS_EX_LAYERED));
}
++it;
}
- delete list;//Handle Floatings//
+ delete list;//Handle Floatings//
return;
}
m_bState = bNewState;
@@ -303,20 +349,32 @@
}
if (m_bState)
time = timeout - time;
+
BYTE d = (BYTE)QMIN((100 - getTransparency() * time / timeout) * 256 / 100, 255);
- slwa(main->winId(), main->colorGroup().background().rgb(), d, LWA_ALPHA);
-
+ if (getIfMainWindow())
+ slwa(main->winId(), main->colorGroup().background().rgb(), d, LWA_ALPHA);
+ else
+ SetWindowLongW(main->winId(), GWL_EXSTYLE, GetWindowLongW(main->winId(), GWL_EXSTYLE) & (~WS_EX_LAYERED));
+
//Handle Floatings
+
QWidgetList *list = QApplication::topLevelWidgets();
QWidgetListIt it(*list);
- QWidget * w;
- while ((w = it.current()) != NULL) {
+ QWidget * w;
+ while ((w = it.current()) != NULL) {
if (w->inherits("FloatyWnd")){
+ //w->installEventFilter(this);
+ //w->setMouseTracking(true);
FloatyWnd *refwnd = static_cast<FloatyWnd*>(w);
- slwa(refwnd->winId(), refwnd->colorGroup().background().rgb(), d, LWA_ALPHA);
+ refwnd->installEventFilter(this);
+ if (getIfFloatings())
+ slwa(refwnd->winId(), refwnd->colorGroup().background().rgb(), d, LWA_ALPHA);
+ else
+ SetWindowLongW(refwnd->winId(), GWL_EXSTYLE, GetWindowLongW(refwnd->winId(), GWL_EXSTYLE) & (~WS_EX_LAYERED));
}
++it;
}//Handle Floatings//
+
#endif
}
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/transparent/transparent.h
^
|
@@ -29,6 +29,8 @@
SIM::Data Transparency;
#ifdef WIN32
SIM::Data IfInactive;
+ SIM::Data IfMainWindow;
+ SIM::Data IfFloatings;
#endif
};
@@ -45,6 +47,8 @@
PROP_ULONG(Transparency);
#ifdef WIN32
PROP_BOOL(IfInactive);
+ PROP_BOOL(IfMainWindow);
+ PROP_BOOL(IfFloatings);
#endif
void setState();
public slots:
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/transparent/transparentcfg.cpp
^
|
@@ -27,9 +27,13 @@
m_plugin = plugin;
sldTransparency->setValue(m_plugin->getTransparency());
#ifdef WIN32
- chkInactive->setChecked(m_plugin->getIfInactive());
+ chkInactive->setChecked (m_plugin->getIfInactive ());
+ chkMainWindow->setChecked(m_plugin->getIfMainWindow());
+ chkFloatings->setChecked (m_plugin->getIfFloatings ());
#else
chkInactive->hide();
+ chkMainWindow->hide();
+ chkFloatings->hide();
#endif
}
@@ -37,7 +41,9 @@
{
m_plugin->setTransparency(sldTransparency->value());
#ifdef WIN32
- m_plugin->setIfInactive(chkInactive->isChecked());
+ m_plugin->setIfInactive (chkInactive ->isChecked());
+ m_plugin->setIfMainWindow(chkMainWindow->isChecked());
+ m_plugin->setIfFloatings (chkFloatings ->isChecked());
#endif
m_plugin->setState();
}
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/transparent/transparentcfgbase.ui
^
|
@@ -22,102 +22,125 @@
<vbox>
<property>
<name>margin</name>
- <number>11</number>
- </property>
+ <number>11</number>
+ </property>
<property>
<name>spacing</name>
- <number>6</number>
- </property>
+ <number>6</number>
+ </property>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel1</cstring>
- </property>
+ </property>
<property>
<name>sizePolicy</name>
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>1</vsizetype>
</sizepolicy>
- </property>
+ </property>
<property>
<name>text</name>
<string>Transparency of main window:</string>
- </property>
+ </property>
<property>
<name>alignment</name>
<set>AlignVCenter|AlignLeft</set>
- </property>
+ </property>
<property>
<name>hAlign</name>
- </property>
- </widget>
+ </property>
+ </widget>
<widget>
<class>QSlider</class>
<property stdset="1">
<name>name</name>
- <cstring>sldTransparency</cstring>
- </property>
+ <cstring>sldTransparency</cstring>
+ </property>
<property>
<name>maxValue</name>
- <number>100</number>
- </property>
+ <number>100</number>
+ </property>
<property>
<name>lineStep</name>
- <number>5</number>
- </property>
+ <number>5</number>
+ </property>
<property>
<name>pageStep</name>
- <number>20</number>
- </property>
+ <number>20</number>
+ </property>
<property>
<name>orientation</name>
- <enum>Horizontal</enum>
- </property>
+ <enum>Horizontal</enum>
+ </property>
<property>
<name>tickmarks</name>
<enum>Right</enum>
- </property>
+ </property>
<property>
<name>tickInterval</name>
- <number>0</number>
- </property>
- </widget>
- <widget>
- <class>QCheckBox</class>
- <property stdset="1">
+ <number>0</number>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
<name>name</name>
<cstring>chkInactive</cstring>
- </property>
- <property>
+ </property>
+ <property>
<name>text</name>
<string>Transparent only if inactive</string>
- </property>
- </widget>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>chkMainWindow</cstring>
+ </property>
+ <property>
+ <name>text</name>
+ <string>Mainwindow</string>
+ </property>
+ </widget>
+
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>chkFloatings</cstring>
+ </property>
+ <property>
+ <name>text</name>
+ <string>Floaties</string>
+ </property>
+ </widget>
<spacer>
<property>
<name>name</name>
<cstring>Spacer9</cstring>
- </property>
+ </property>
<property>
<name>orientation</name>
<enum>Vertical</enum>
- </property>
+ </property>
<property>
<name>sizeType</name>
<enum>Expanding</enum>
- </property>
+ </property>
<property>
<name>sizeHint</name>
<size>
<width>20</width>
<height>20</height>
</size>
- </property>
+ </property>
</spacer>
</vbox>
-</widget>
+ </widget>
<customwidgets>
<customwidget>
<class>QWidget</class>
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/update/update.cpp
^
|
@@ -235,6 +235,10 @@
bool UpdatePlugin::isUpdateNeeded(QString& local, QString& remote){
+ /*
+ The remote-String in win32 is generated in following format:
+ echo %SIMVERSION% %SIMTAG% %SVNTAG% %DATE% %TIME% >update.php
+ */
//Cut the Time away
remote = remote.stripWhiteSpace();
remote = remote.left(remote.length()-11);
@@ -254,11 +258,13 @@
if (search.compare(local.section(' ',0,0, QString::SectionDefault))==0)
break;
}
-
this->dlocal = QDate(local.right(4).toInt(), i+1 , local.section(' ',1,1, QString::SectionDefault).toInt());
this->dremote = QDate(remote.right(4).toInt(), remote.mid(3,2).toInt(), remote.left(2).toInt());
+ if (dremote.isNull()) QMessageBox::critical( 0, i18n("Update Plugin: Error fetching the date of the current Update Setup."),
+ i18n("Please contact and inform me via noragen@gmx.net about this issue. //\\//oRaGen."));
+
//local=dlocal->toString();
//remote=dremote->toString();
if (dlocal.daysTo(dremote)>0)
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/windock/CMakeLists.txt
^
|
@@ -15,5 +15,5 @@
SIM_ADD_PLUGIN(windock)
ELSE(WIN32)
- MESSAGE(STATUS "This plugin can only be used on windows")
+ MESSAGE(STATUS "Windock plugin can only be used on windows")
ENDIF(WIN32)
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/plugins/yahoo/yahooclient.cpp
^
|
@@ -256,7 +256,7 @@
}
socket()->writeBuffer().packetStart();
socket()->writeBuffer().pack(YAHOO_PACKET_SIGN, 4);
- socket()->writeBuffer() << 0x000B0000L << size << service << status << m_session;
+ socket()->writeBuffer() << 0x000C0000L << size << service << status << m_session;
if (size){
for (list<PARAM>::iterator it = m_values.begin(); it != m_values.end(); ++it){
socket()->writeBuffer()
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/sim.vcproj
^
|
@@ -169,7 +169,7 @@
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
- SubSystem="2"
+ SubSystem="1"
TargetMachine="1"
/>
<Tool
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/sim/Makefile.am
^
|
@@ -65,7 +65,7 @@
desktopdir=$(xdg_appsdir)/
# set the include path for X, qt and KDE
-INCLUDES = $(LTDLINCL) $(all_includes)
+INCLUDES=$(LTDLINCL) -I. -I../plugins/_core $(all_includes)
METASOURCES = AUTO
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/sim/Makefile.in
^
|
@@ -503,7 +503,7 @@
desktopdir = $(xdg_appsdir)/
# set the include path for X, qt and KDE
-INCLUDES = $(LTDLINCL) $(all_includes)
+INCLUDES = $(LTDLINCL) -I. -I../plugins/_core $(all_includes)
#>- METASOURCES = AUTO
# the library search path.
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/sim/contacts.h
^
|
@@ -190,11 +190,13 @@
const unsigned STATUS_UNKNOWN = 0;
const unsigned STATUS_OFFLINE = 1;
-const unsigned STATUS_NA = 10;
-const unsigned STATUS_DND = 20;
-const unsigned STATUS_AWAY = 30;
-const unsigned STATUS_ONLINE = 40;
-const unsigned STATUS_FFC = 50;
+const unsigned STATUS_INVISIBLE = 2;
+const unsigned STATUS_DND = 10;
+const unsigned STATUS_OCCUPIED = 20;
+const unsigned STATUS_NA = 30;
+const unsigned STATUS_AWAY = 40;
+const unsigned STATUS_ONLINE = 50;
+const unsigned STATUS_FFC = 60;
const unsigned CONTACT_UNDERLINE = 0x0001;
const unsigned CONTACT_ITALIC = 0x0002;
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/sim/sslclient.cpp
^
|
@@ -415,7 +415,8 @@
bool SSLClient::initTLS1(bool bDH)
{
- mpCTX = SSL_CTX_new(TLSv1_method());
+ //mpCTX = SSL_CTX_new(TLSv1_method());
+ mpCTX = SSL_CTX_new(SSLv23_client_method()); // FIXME This is a hotfix that should fix bug #12510 Might be this change should be reverted once...
if (mpCTX == NULL)
return false;
if (bDH){
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/sim/textshow.cpp
^
|
@@ -104,13 +104,18 @@
m_bSelected = false;
}
+
void TextEdit::slotTextChanged()
{
bool bEmpty = isEmpty();
if (m_bEmpty == bEmpty)
return;
m_bEmpty = bEmpty;
- emit emptyChanged(m_bEmpty);
+
+ Command cmd;
+ cmd->id = CmdSend;
+ cmd->flags = bEmpty ? COMMAND_DISABLED : 0;
+ EventCommandDisabled(cmd).process();
}
void TextEdit::slotClicked(int,int)
|
[-]
[+]
|
Changed |
sim-0.9.5.tar.bz2/sim/textshow.h
^
|
@@ -20,6 +20,8 @@
#include "simapi.h"
#include "event.h"
+#include "core.h"
+#include "msggen.h"
#include <qglobal.h>
#include <qmainwindow.h>
|