From cc29364f06178f8f6b457384f2ec37a042bd9d43 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 1 Sep 2010 00:37:02 +0000 Subject: * Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch * Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- libkpgp/kpgp.cpp | 2 +- libkpgp/kpgpbase.cpp | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'libkpgp') diff --git a/libkpgp/kpgp.cpp b/libkpgp/kpgp.cpp index ec80e6887..8a9c68989 100644 --- a/libkpgp/kpgp.cpp +++ b/libkpgp/kpgp.cpp @@ -1007,7 +1007,7 @@ Module::getKpgp() { if (!kpgpObject) { - kdError(5100) << "there is no instance of kpgp available" << endl; + kpgpObject = new Module(); } return kpgpObject; } diff --git a/libkpgp/kpgpbase.cpp b/libkpgp/kpgpbase.cpp index fa444be7f..157c73e3b 100644 --- a/libkpgp/kpgpbase.cpp +++ b/libkpgp/kpgpbase.cpp @@ -149,7 +149,8 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP ) if (!onlyReadFromPGP) { if (!input.isEmpty()) { // write to pin[1] one line after the other to prevent dead lock - for (unsigned int i=0; i 2) { if (poller[STD_IN].revents & ( POLLERR | POLLHUP ) ) { kdDebug(5100) << "GnuPG seems to have hung up" << endl; @@ -597,17 +599,17 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG ) if (!input.isEmpty()) { // search end of next line if ((len2 = input.find('\n', input_pos)) == -1) - len2 = input.length()-input_pos; + len2 = input_length - input_pos; else - len2 = len2-input_pos+1; + len2 = len2 - input_pos + 1; //kdDebug(5100) << "Trying to write " << len2 << " bytes to pin[1] ..." << endl; - len2 = write(pin[1], input.mid(input_pos,len2).data(), len2); + len2 = write(pin[1], input.data() + input_pos, len2 ); //kdDebug(5100) << "Wrote " << len2 << " bytes to pin[1] ..." << endl; input_pos += len2; // We are done. - if (input_pos >= input.length()) { + if (input_pos >= input_length) { //kdDebug(5100) << "All input was written to pin[1]" << endl; close (pin[1]); pin[1] = -1; @@ -635,7 +637,7 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG ) } while(waitpidRetVal == 0); if( 0 <= pin[1] ) - close (pin[1]); + close (pin[1]); close(pout[0]); close(perr[0]); @@ -646,7 +648,7 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG ) if (WIFEXITED(childExitStatus) != 0) { // Get the return code of the child childExitStatus = WEXITSTATUS(childExitStatus); - kdDebug(5100) << "GnuPG exited with exit status " << childExitStatus + kdDebug(5100) << "GnuPG exited with exit status " << childExitStatus << endl; } else { -- cgit v1.2.1