[prev in list] [next in list] [prev in thread] [next in thread]
List: kopete-devel
Subject: Re: [kopete-devel] [PATCH] Winpopup protocol
From: Pali Rohár <pali.rohar () gmail ! com>
Date: 2008-11-30 6:22:11
Message-ID: 49323113.9070701 () gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
[Attachment #4 (multipart/mixed)]
So, I'm sending new patch, which fix only calling smbclient.
--
Pali Rohár
pali.rohar@gmail.com
Nicolas Lécureuil wrote / napísal(a):
> Le Saturday 29 November 2008 20:36:25 Maciej Mrozowski, vous avez écrit :
>
>> On Saturday 29 of November 2008 13:23:16 Pali Rohár wrote:
>>
>>> Hello,
>>> kdesudo exists, but kdesu not (File /usr/bin/kdesudo isn't symlink to
>>> /usr/bin/kdesu) and in winpopup protocol is kdesu (not kdesudo) so
>>> without patch protocol doesn't works.
>>>
>> Yes, probably, but AFAIK kubuntu is not the only Linux distribution on the
>> world, besides KDE targets other platforms as well. KDE4 built from trunk
>> provides kdesu and kdesud (in libexec) binaries - no kdesudo - and all KDE
>> modules and libs should be developed to depend on *stock*/upstream
>> configuration - not specific distribution layout IMHO.
>>
>
> exactly and just to take us (Mandriva) as exemple, we do not have kdesudo at
> all in the distribution.
>
>
["winpopup.patch" (text/x-patch)]
Index: winpopup/libwinpopup/libwinpopup.cpp
===================================================================
--- winpopup/libwinpopup/libwinpopup.cpp (revision 890402)
+++ winpopup/libwinpopup/libwinpopup.cpp (working copy)
@@ -119,7 +119,7 @@
if (tmpPerms != 0777) {
- kDebug(14170) << "Perms not ok!";
+ kDebug() << "Perms not ok!";
int tmpYesNo = KMessageBox::warningYesNo(Kopete::UI::Global::mainWidget(),
i18n("Permissions of the working directory "
@@ -154,6 +154,8 @@
void WinPopupLib::startReadProcess(const QString &Host)
{
+ kDebug() << "Getting info about" << Host << endl;
+
currentHosts.clear();
currentGroups.clear();
currentGroup.clear();
@@ -161,23 +163,28 @@
// for Samba 3
readGroupsProcess = new QProcess;
QStringList args;
- args << "-N" << "-g" << "-L" << Host << "-";
+ args << "-N" << "-g" << "-L" << Host;
connect(readGroupsProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, \
SLOT(slotReadProcessExited(int, QProcess::ExitStatus)));
readGroupsProcess->setProcessChannelMode(QProcess::MergedChannels);
readGroupsProcess->start(smbClientBin, args);
+
+ kDebug() << "Starting smbclient" << smbClientBin << args << endl;
}
void WinPopupLib::slotReadProcessExited(int i, QProcess::ExitStatus status)
{
if (i > 0 || status == QProcess::CrashExit) {
+ kDebug() << "smbclient crashed" << endl;
todo.removeAll(currentHost);
done += currentHost;
} else {
+ kDebug() << "smbclient exit successful" << endl;
QByteArray outputData = readGroupsProcess->readAll();
if (!outputData.isEmpty()) {
QString outputString = QString::fromUtf8(outputData.data());
+ kDebug() << "smbclient output:" << endl << outputString << endl;
QStringList outputList = outputString.split('\n');
QRegExp group("Workgroup\\|(.[^\\|]+)\\|(.+)"), \
host("Server\\|(.[^\\|]+)\\|(.+)"),
info("Domain=\\[([^\\]]+)\\] OS=\\[([^\\]]+)\\] Server=\\[([^\\]]+)\\]"),
@@ -187,15 +194,20 @@
if (host.indexIn(line) != -1) currentHosts += host.cap(1);
if (group.indexIn(line) != -1) currentGroups[group.cap(1)] = group.cap(2);
}
+ } else {
+ kDebug() << "smbclient output: (empty)" << endl;
}
delete readGroupsProcess;
readGroupsProcess = 0;
+ kDebug() << "Current Hosts:" << currentHosts << endl;
+
// Drop the first cycle - it's only the initial search host,
// the next round are the real masters. GF
if (passedInitialHost) {
+ kDebug() << "Passed Initial Host" << endl;
// move currentHost from todo to done
todo.removeAll(currentHost);
@@ -221,6 +233,7 @@
}
} else {
+ kDebug() << "Not Passed Initial Host" << endl;
passedInitialHost = true;
if (!currentGroups.isEmpty()) {
foreach (QString groupMaster, currentGroups) {
@@ -292,7 +305,7 @@
if (!messageFile.remove()) {
// QFile::remove() seems to be very persistent, it removes even files with 0444 \
owned by root
// if the directory permissions are 0777 - so this is just for safety. GF
- kDebug(14170) << "Message file not removed - how that?";
+ kDebug() << "Message file not removed - how that?";
int tmpYesNo = KMessageBox::warningYesNo(Kopete::UI::Global::mainWidget(),
i18n("A message file could not be removed; "
"maybe the permissions are incorrect.\n"
@@ -309,7 +322,7 @@
if (!sender.isEmpty() && time.isValid())
emit signalNewMessage(text, time, sender);
else
- kDebug(14170) << "Received invalid message!";
+ kDebug() << "Received invalid message!";
}
} // isFile
} // foreach
@@ -320,12 +333,14 @@
*/
void WinPopupLib::sendMessage(const QString &Body, const QString &Destination)
{
+ kDebug() << "Sending message" << Body.trimmed() << "to" << Destination << endl;
QProcess *sender = new QProcess(this);
QStringList args;
- args << "-M" << Destination << "-N" << "-";
+ args << "-M" << Destination << "-N";
sender->start(smbClientBin, args);
sender->write(Body.trimmed().toLocal8Bit());
sender->closeWriteChannel();
+ kDebug() << "Staring smbclient" << smbClientBin << args << endl;
}
void WinPopupLib::settingsChanged(const QString &smbClient, int groupFreq)
["signature.asc" (application/pgp-signature)]
_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic