+ thread test

+ thread test

--- tests/init.cpp
+++ tests/init.cpp
@@ -1,18 +1,35 @@
-#include "catch.hpp"
-
 #include "stack.hpp"
-
+stack<int> st;
+TEST_CASE("Thow threads", "[T]") {
+	std::thread thread1([]() {
+		for (size_t i = 0; i < 100; i++) {
+			st.push(rand());
+		}
+	});
+	std::thread thread2([]() {
+		for (size_t i = 0; i < 100;) {
+			if (!st.empty()) {
+				std::cout << st.top() << std::endl;
+				st.pop();
+				i++;
+			}
+		}
+	});
+	thread1.join();
+	thread2.join();
+}
 TEST_CASE("Stack can be instantiated by various types", "[instantiation]") {
 	REQUIRE_NOTHROW(stack<int> st1);
-	REQUIRE_NOTHROW(stack<double> st1);
-	REQUIRE_NOTHROW(stack<char> st1);
-	REQUIRE_NOTHROW(stack<int*> st1);
-	REQUIRE_NOTHROW(stack<stack<int>> st1);
+	REQUIRE_NOTHROW(stack<double> st2);
+	REQUIRE_NOTHROW(stack<char> st3);
+	REQUIRE_NOTHROW(stack<int*> st4);
+	REQUIRE_NOTHROW(stack<stack<int>> st5);
 }
 TEST_CASE("Push, pop, top", "[push_pop_top]") {
 	stack<int> st;
 	st.push(1);
 	st.push(2);
+	st.top();
 	REQUIRE(st.top() == 2);
 	st.pop();
 	REQUIRE(st.top() == 1);
@@ -31,13 +48,15 @@
 	REQUIRE(st.count() == 0);
 }
 TEST_CASE("Copy constructor", "[copy_ctr]") {
-	stack<int> st1;
+	stack<double> st1;
 	st1.push(1);
 	st1.push(2);
-	REQUIRE_NOTHROW(stack<int> st2 = st1);
+	//REQUIRE_NOTHROW(stack<double> st2 = st1);

-	stack<int> st3 = st1;
-	stack<int> st4 = st1;
+	stack<double> st3;
+	st3 = st1;
+	stack<double> st4;
+	st4 = st1;
 	REQUIRE(st1.top() == 2);
 	REQUIRE(st3.top() == 2);
 	st3.pop();
@@ -70,14 +89,14 @@
 		A() {
 			throw "ctor is called";
 		}
-		A(int a) {
+		A(int a) {
 			;
 		}
 	};
 	REQUIRE_NOTHROW(
 		stack<A> st;
-		st.push(4);
-		st.push(20);
+	st.push(4);
+	st.push(20);
 	);
 	class B {
 	public:
@@ -88,19 +107,22 @@
 	stack<B> st;
 	st.push(40);
 }
-bool dtor_is_called1 = false;
-TEST_CASE("Allocator calls dtors", "[allocator]") {
+bool dtor_is_called12 = false;
+TEST_CASE("Allocator calls dtor when pop", "[allocator_dtor]") {
 	class A {
 	public:
 		A(int a) {
-			;
+			//std::cout << "A(int)" << std::endl;
+		}
+		A(const A & a) {
+			//std::cout << "copy constructor is called " << std::endl;
 		}
 		~A() {
-			dtor_is_called1 = true;
+			dtor_is_called12 = true;
 		}
 	};
 	stack<A> st;
 	st.push(32);
 	st.pop();
-	REQUIRE(dtor_is_called1);
+	REQUIRE(dtor_is_called12);
 }


more refactoring and added List32 to DeleteObj

--- tests/list.cpp
+++ tests/list.cpp
@@ -46,6 +46,9 @@
     co_obj_t *TestString2;
     co_obj_t *TestString3;

+    int ret;
+    co_obj_t *ptr;
+
     ListTest()
     {
       List16 = co_list16_create();
@@ -54,6 +57,9 @@
       TestString1 = co_bin8_create("1TESTVALUE1", 12, 0);
       TestString2 = co_bin8_create("2TESTVALUE2", 12, 0);
       TestString3 = co_bin8_create("3TESTVALUE3", 12, 0);
+
+      ret = 0;
+      ptr = NULL;
     }

     virtual void SetUp()
@@ -69,7 +75,7 @@

 void ListTest::InsertObj()
 {
-  int ret = co_list_append(List16, TestString1);
+  ret = co_list_append(List16, TestString1);
   ASSERT_EQ(1, ret);

   ret = co_list_contains(List16, TestString1);
@@ -99,7 +105,7 @@

 void ListTest::DeleteObj()
 {
-  int ret = co_list_append(List16, TestString1);
+  ret = co_list_append(List16, TestString1);
   ASSERT_EQ(1, ret);

   co_obj_t *ptr = co_list_delete(List16, TestString1);
@@ -109,6 +115,19 @@
   ASSERT_EQ(1, ret);

   ptr = co_list_delete(List16, TestString2);
+  ASSERT_EQ(TestString2, ptr);
+
+  // repeat for List32
+  ret = co_list_append(List32, TestString1);
+  ASSERT_EQ(1, ret);
+
+  ptr = co_list_delete(List32, TestString1);
+  ASSERT_EQ(TestString1, ptr);
+
+  ret = co_list_append(List32, TestString2);
+  ASSERT_EQ(1, ret);
+
+  ptr = co_list_delete(List32, TestString2);
   ASSERT_EQ(TestString2, ptr);
 }


test against the specified memory_alignment<Vec>::value and not some heuristic value

--- tests/load.cpp
+++ tests/load.cpp
@@ -57,7 +57,7 @@
     Vc::Memory<Vec, 10> a;
     b = a;
     hack_to_put_b_on_the_stack = &b;
-    unsigned long mask = alignmentMask<Vec>();
+    size_t mask = memory_alignment<Vec>::value - 1;
     for (int i = 0; i < 10; ++i) {
         VERIFY((reinterpret_cast<size_t>(&b[i * Vec::Size]) & mask) == 0) << "b = " << b << ", mask = " << mask;
     }


style(tests): make tiny renaming

style(tests): make tiny renaming

--- tests/root.cpp
+++ tests/root.cpp
@@ -31,14 +31,14 @@

 TEST(Root, ForwardToHandler) {
     std::unique_ptr<mock::handler_t> handler(new mock::handler_t);
-    auto& handler_ = *handler.get();
+    auto& mock = *handler.get();

     std::vector<std::unique_ptr<handler_t>> handlers;
     handlers.push_back(std::move(handler));

     root_logger_t logger(std::move(handlers));

-    EXPECT_CALL(handler_, execute(_))
+    EXPECT_CALL(mock, execute(_))
         .Times(1);

     logger.log(0, "GET /porn.png HTTP/1.1");


Remove.

Remove.

git-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@56256 91177308-0d34-0410-b5e6-96231b3b80d8

--- PassManagerUtils.cpp
+++ PassManagerUtils.cpp
@@ -1,108 +0,0 @@
-//===-- PassManagerUtils.cpp - --------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements pass manager utiliy routines.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/PassManagerUtils.h"
-#include "llvm/PassManagers.h"
-#include "llvm/Transforms/Scalar.h"
-#include "llvm/Transforms/IPO.h"
-#include "llvm/Analysis/LoopPass.h"
-
-/// AddOptimizationPasses - This routine adds optimization passes
-/// based on selected optimization level, OptLevel. This routine is
-/// used by llvm-gcc and other tools.
-///
-/// OptLevel - Optimization Level
-/// EnableIPO - Enables IPO passes. llvm-gcc enables this when
-///             flag_unit_at_a_time is set.
-/// InlinerSelection - 1 : Add function inliner.
-///                  - 2 : Add AlwaysInliner.
-/// OptLibCalls - Simplify lib calls, if set.
-/// PruneEH - Add PruneEHPass, if set.
-/// UnrollLoop - Unroll loops, if set.
-void llvm::AddOptimizationPasses(FunctionPassManager &FPM, PassManager &MPM,
-                                 unsigned OptLevel, bool EnableIPO,
-                                 unsigned InlinerSelection, bool OptLibCalls,
-                                 bool PruneEH, bool UnrollLoop) {
-  if (OptLevel == 0)
-    return;
-
-  FPM.add(createCFGSimplificationPass());
-  if (OptLevel == 1)
-    FPM.add(createPromoteMemoryToRegisterPass());
-  else
-    FPM.add(createScalarReplAggregatesPass());
-  FPM.add(createInstructionCombiningPass());
-
-  if (EnableIPO)
-    MPM.add(createRaiseAllocationsPass());      // call %malloc -> malloc inst
-  MPM.add(createCFGSimplificationPass());       // Clean up disgusting code
-  MPM.add(createPromoteMemoryToRegisterPass()); // Kill useless allocas
-  if (EnableIPO) {
-    MPM.add(createGlobalOptimizerPass());       // OptLevel out global vars
-    MPM.add(createGlobalDCEPass());             // Remove unused fns and globs
-    MPM.add(createIPConstantPropagationPass()); // IP Constant Propagation
-    MPM.add(createDeadArgEliminationPass());    // Dead argument elimination
-  }
-  MPM.add(createInstructionCombiningPass());    // Clean up after IPCP & DAE
-  MPM.add(createCFGSimplificationPass());       // Clean up after IPCP & DAE
-  if (EnableIPO && PruneEH)
-    MPM.add(createPruneEHPass());               // Remove dead EH info
-  if (InlinerSelection == 1)                    // respect -fno-inline-functions
-    MPM.add(createFunctionInliningPass());      // Inline small functions
-  else if (InlinerSelection == 2)
-    MPM.add(createAlwaysInlinerPass());         // Inline always_inline functions
-  if (OptLevel > 2)
-    MPM.add(createArgumentPromotionPass());   // Scalarize uninlined fn args
-  if (OptLibCalls)
-    MPM.add(createSimplifyLibCallsPass());    // Library Call Optimizations
-  MPM.add(createInstructionCombiningPass());  // Cleanup for scalarrepl.
-  MPM.add(createJumpThreadingPass());         // Thread jumps.
-  MPM.add(createCFGSimplificationPass());     // Merge & remove BBs
-  MPM.add(createScalarReplAggregatesPass());  // Break up aggregate allocas
-  MPM.add(createInstructionCombiningPass());  // Combine silly seq's
-  MPM.add(createCondPropagationPass());       // Propagate conditionals
-  MPM.add(createTailCallEliminationPass());   // Eliminate tail calls
-  MPM.add(createCFGSimplificationPass());     // Merge & remove BBs
-  MPM.add(createReassociatePass());           // Reassociate expressions
-  MPM.add(createLoopRotatePass());            // Rotate Loop
-  MPM.add(createLICMPass());                  // Hoist loop invariants
-  MPM.add(createLoopUnswitchPass());
-  MPM.add(createLoopIndexSplitPass());        // Split loop index
-  MPM.add(createInstructionCombiningPass());
-  MPM.add(createIndVarSimplifyPass());        // Canonicalize indvars
-  MPM.add(createLoopDeletionPass());          // Delete dead loops
-  if (UnrollLoop)
-    MPM.add(createLoopUnrollPass());          // Unroll small loops
-  MPM.add(createInstructionCombiningPass());  // Clean up after the unroller
-  MPM.add(createGVNPass());                   // Remove redundancies
-  MPM.add(createMemCpyOptPass());             // Remove memcpy / form memset
-  MPM.add(createSCCPPass());                  // Constant prop with SCCP
-
-  // Run instcombine after redundancy elimination to exploit opportunities
-  // opened up by them.
-  MPM.add(createInstructionCombiningPass());
-  MPM.add(createCondPropagationPass());       // Propagate conditionals
-  MPM.add(createDeadStoreEliminationPass());  // Delete dead stores
-  MPM.add(createAggressiveDCEPass());   // Delete dead instructions
-  MPM.add(createCFGSimplificationPass());     // Merge & remove BBs
-
-  if (EnableIPO) {
-    MPM.add(createStripDeadPrototypesPass());   // Get rid of dead prototypes
-    MPM.add(createDeadTypeEliminationPass());   // Eliminate dead types
-  }
-
-  if (OptLevel > 1 && EnableIPO)
-    MPM.add(createConstantMergePass());       // Merge dup global constants
-
-  return;
-}


minor edit: made the search results treeview a teensy bit taller

--- campcaster/src/products/gLiveSupport/src/SearchWindow.cxx
+++ campcaster/src/products/gLiveSupport/src/SearchWindow.cxx
@@ -130,7 +130,7 @@

     // set the sizes of the two parts of the window
     searchInput      ->set_size_request(750, 231);
-    searchResultsView->set_size_request(750, 340);
+    searchResultsView->set_size_request(750, 343);

     // put them in one big box
     Gtk::VBox *         bigBox = Gtk::manage(new Gtk::VBox);


- Turned x vectors into scalars.

- Turned x vectors into scalars.

--- PrecompData_test.cpp
+++ PrecompData_test.cpp
@@ -107,25 +107,24 @@
 	// Test - Test mathematical functions
 	{
 		cout << "\n\nTest: Test mathematical functions: " << endl;
-		pcd12::X x = { {0.00f, 0.00f} };
+		float x = 0.0f;
 		pcd12::YData y, y_ok;
 		y_ok[0] = 1.0;
 		y = TestFunc12(x);
 		cerr << "Expected result = " << y_ok[0] << ";  Actual result = " << y[0] << endl;
 		assert(abs(y[0] - y_ok[0]) < 1.0e-2f);

-		x = { {3.141f, 3.141f} };
+		x = 3.141f;
 		y_ok[0] = -1.0;
 		y = TestFunc12(x);
 		cerr << "Expected result = " << y_ok[0] << ";  Actual result = " << y[0] << endl;
 		assert(abs(y[0] - y_ok[0]) < 1.0e-2f);

-		x = { {6.282f, 6.282f} };
+		x = 6.282f;
 		y_ok[0] = 1.0;
 		y = TestFunc12(x);
 		cerr << "Expected result = " << y_ok[0] << ";  Actual result = " << y[0] << endl;
 		assert(abs(y[0] - y_ok[0]) < 1.0e-2f);
-

 		cout << " OK" << endl;
 	}
@@ -136,8 +135,8 @@
 		const string funcName = "TestFunc";
 		pcd12 itp(funcName);
 		itp.SetComment("Y = f(X)    X = x(i,j), Y = y(i)");
-		const pcd12::X x0 = { {0.00f, 0.00f} };
-		const pcd12::X x1 = { {6.28f, 6.28f} };
+		const float x0 = 0.00f;
+		const float x1 = 6.28f;
 		itp.Set(&TestFunc12, x0, x1, nValues*nValues);

 		//itp.Dump();


Extend the output of TTree::Print(debugInfo) to include the action sequence information (and add support for the sub option 'func' that also prints the function's (mangled) name

git-svn-id: 9d02132d8e1217b86764d694e1605987040d84e5@48986 27541ba8-7e3a-0410-8455-c3a389f83636

--- tree/tree/src/TBranchElement.cxx
+++ tree/tree/src/TBranchElement.cxx
@@ -3171,18 +3171,25 @@
       return;
    }
    if (strncmp(option,"debugInfo",strlen("debugInfo"))==0)  {
-      Printf("Branch %s uses:\n",GetName());
+      Printf("Branch %s uses:",GetName());
       if (fID>=0) {
          ULong_t* elems = GetInfoImp()->GetElems();
          ((TStreamerElement*) elems[fID])->ls();
          for(UInt_t i=0; i< fIDs.size(); ++i) {
             ((TStreamerElement*) elems[fIDs[i]])->ls();
          }
-      }
+         Printf("   with read actions:");
+         if (fReadActionSequence) fReadActionSequence->Print(option);
+         Printf("   with write actions:");
+         if (fFillActionSequence) fFillActionSequence->Print(option);
+      }
+      TString suboption = "debugInfoSub";
+      suboption += (option+strlen("debugInfo"));
       for (Int_t i = 0; i < nbranches; ++i) {
          TBranchElement* subbranch = (TBranchElement*)fBranches.At(i);
-         subbranch->Print("debugInfoSub");
-      }
+         subbranch->Print(suboption);
+      }
+      Printf(" ");
       return;
    }
    if (nbranches) {


Set the virtual array size to 1, in all cases where the branch is not part of a collection

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@41521 27541ba8-7e3a-0410-8455-c3a389f83636

--- tree/tree/src/TBranchElement.cxx
+++ tree/tree/src/TBranchElement.cxx
@@ -3843,7 +3843,7 @@
    if (!info) {
       return;
    }
-   R__PushCache onfileObject(((TBufferFile&)b),fOnfileObject,fNdata);
+   R__PushCache onfileObject(((TBufferFile&)b),fOnfileObject,1); // Here we have a single object that contains a variable size C-style array.
    // Since info is not null, fReadActionSequence is not null either.
    b.ApplySequence(*fReadActionSequence, fObject);
 }
@@ -3877,9 +3877,10 @@
    if (!info) {
       return;
    }
+
+   R__PushCache onfileObject(((TBufferFile&)b),fOnfileObject,1);
+
    // Since info is not null, fReadActionSequence is not null either.
-   R__PushCache onfileObject(((TBufferFile&)b),fOnfileObject,fNdata);
-
    b.ApplySequence(*fReadActionSequence, fObject);
    fNdata = (Int_t) GetValue(0, 0);
 }


Expose DOM node display style as IAccessible2 object attribute.

BUG=47135
TEST=Manual. See bug for NVDA verification steps.

Review URL: http://codereview.chromium.org/4493001

git-svn-id: http://src.chromium.org/svn/trunk/src@65264 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 0f690a791e96f140e922a918e29561f890ae8e50

--- chrome/browser/accessibility/browser_accessibility_win.cc
+++ chrome/browser/accessibility/browser_accessibility_win.cc
@@ -1117,6 +1117,11 @@
           IsAsciiDigit(role_name_[1])) {
     html_attributes_.push_back(std::make_pair(L"level", role_name_.substr(1)));
   }
+
+  // Expose the "display" object attribute.
+  string16 display;
+  if (GetAttribute(WebAccessibility::ATTR_DISPLAY, &display))
+    html_attributes_.push_back(std::make_pair(L"display", display));

   // If this object doesn't have a name but it does have a description,
   // use the description as its name - because some screen readers only


Convert comments to CurrentlyOn checks.

Convert comments to CurrentlyOn checks.

BUG=none
TEST=trybots

Review URL: http://codereview.chromium.org/6254001

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@71341 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

--- chrome/browser/renderer_host/render_message_filter_gtk.cc
+++ chrome/browser/renderer_host/render_message_filter_gtk.cc
@@ -46,9 +46,9 @@
 // We get null window_ids passed into the two functions below; please see
 // http://crbug.com/9060 for more details.

-// Called on the BACKGROUND_X11 thread.
 void RenderMessageFilter::DoOnGetScreenInfo(gfx::NativeViewId view,
                                             IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::BACKGROUND_X11));
   Display* display = x11_util::GetSecondaryDisplay();
   int screen = x11_util::GetDefaultScreen(display);
   WebScreenInfo results = WebScreenInfoFactory::screenInfo(display, screen);
@@ -56,9 +56,9 @@
   Send(reply_msg);
 }

-// Called on the BACKGROUND_X11 thread.
 void RenderMessageFilter::DoOnGetWindowRect(gfx::NativeViewId view,
                                             IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::BACKGROUND_X11));
   // This is called to get the x, y offset (in screen coordinates) of the given
   // view and its width and height.
   gfx::Rect rect;
@@ -92,9 +92,9 @@
   return GetTopLevelWindow(parent_window);
 }

-// Called on the BACKGROUND_X11 thread.
 void RenderMessageFilter::DoOnGetRootWindowRect(gfx::NativeViewId view,
                                                 IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::BACKGROUND_X11));
   // This is called to get the screen coordinates and size of the browser
   // window itself.
   gfx::Rect rect;
@@ -117,19 +117,19 @@
   Send(reply_msg);
 }

-// Called on the UI thread.
 void RenderMessageFilter::DoOnClipboardIsFormatAvailable(
     ui::Clipboard::FormatType format, ui::Clipboard::Buffer buffer,
     IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   const bool result = GetClipboard()->IsFormatAvailable(format, buffer);

   ViewHostMsg_ClipboardIsFormatAvailable::WriteReplyParams(reply_msg, result);
   Send(reply_msg);
 }

-// Called on the UI thread.
 void RenderMessageFilter::DoOnClipboardReadText(ui::Clipboard::Buffer buffer,
                                                 IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   string16 result;
   GetClipboard()->ReadText(buffer, &result);

@@ -137,9 +137,9 @@
   Send(reply_msg);
 }

-// Called on the UI thread.
 void RenderMessageFilter::DoOnClipboardReadAsciiText(
     ui::Clipboard::Buffer buffer, IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   std::string result;
   GetClipboard()->ReadAsciiText(buffer, &result);

@@ -147,9 +147,9 @@
   Send(reply_msg);
 }

-// Called on the UI thread.
 void RenderMessageFilter::DoOnClipboardReadHTML(ui::Clipboard::Buffer buffer,
                                                 IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   std::string src_url_str;
   string16 markup;
   GetClipboard()->ReadHTML(buffer, &markup, &src_url_str);
@@ -159,21 +159,21 @@
   Send(reply_msg);
 }

-// Called on the UI thread.
 void RenderMessageFilter::DoOnClipboardReadAvailableTypes(
     ui::Clipboard::Buffer buffer, IPC::Message* reply_msg) {
-  Send(reply_msg);
-}
-
-// Called on the UI thread.
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+  Send(reply_msg);
+}
+
 void RenderMessageFilter::DoOnClipboardReadData(ui::Clipboard::Buffer buffer,
                                                 const string16& type,
                                                 IPC::Message* reply_msg) {
-  Send(reply_msg);
-}
-// Called on the UI thread.
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+  Send(reply_msg);
+}
 void RenderMessageFilter::DoOnClipboardReadFilenames(
     ui::Clipboard::Buffer buffer, IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   Send(reply_msg);
 }

@@ -235,37 +235,37 @@
   map->erase(it);
 }

-// Called on the IO thread.
 void RenderMessageFilter::OnGetScreenInfo(gfx::NativeViewId view,
                                           IPC::Message* reply_msg) {
-   BrowserThread::PostTask(
-      BrowserThread::BACKGROUND_X11, FROM_HERE,
-      NewRunnableMethod(
-          this, &RenderMessageFilter::DoOnGetScreenInfo, view, reply_msg));
-}
-
-// Called on the IO thread.
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+  BrowserThread::PostTask(
+     BrowserThread::BACKGROUND_X11, FROM_HERE,
+     NewRunnableMethod(
+         this, &RenderMessageFilter::DoOnGetScreenInfo, view, reply_msg));
+}
+
 void RenderMessageFilter::OnGetWindowRect(gfx::NativeViewId view,
                                           IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   BrowserThread::PostTask(
       BrowserThread::BACKGROUND_X11, FROM_HERE,
       NewRunnableMethod(
           this, &RenderMessageFilter::DoOnGetWindowRect, view, reply_msg));
 }

-// Called on the IO thread.
 void RenderMessageFilter::OnGetRootWindowRect(gfx::NativeViewId view,
                                               IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   BrowserThread::PostTask(
       BrowserThread::BACKGROUND_X11, FROM_HERE,
       NewRunnableMethod(
           this, &RenderMessageFilter::DoOnGetRootWindowRect, view, reply_msg));
 }

-// Called on the IO thread.
 void RenderMessageFilter::OnClipboardIsFormatAvailable(
     ui::Clipboard::FormatType format, ui::Clipboard::Buffer buffer,
     IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   BrowserThread::PostTask(
       BrowserThread::UI, FROM_HERE,
       NewRunnableMethod(
@@ -273,9 +273,9 @@
           buffer, reply_msg));
 }

-// Called on the IO thread.
 void RenderMessageFilter::OnClipboardReadText(ui::Clipboard::Buffer buffer,
                                               IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   BrowserThread::PostTask(
       BrowserThread::UI, FROM_HERE,
       NewRunnableMethod(
@@ -283,9 +283,9 @@
           reply_msg));
 }

-// Called on the IO thread.
 void RenderMessageFilter::OnClipboardReadAsciiText(ui::Clipboard::Buffer buffer,
                                                    IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   BrowserThread::PostTask(
       BrowserThread::UI, FROM_HERE,
       NewRunnableMethod(
@@ -293,9 +293,9 @@
           reply_msg));
 }

-// Called on the IO thread.
 void RenderMessageFilter::OnClipboardReadHTML(ui::Clipboard::Buffer buffer,
                                               IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   BrowserThread::PostTask(
       BrowserThread::UI, FROM_HERE,
       NewRunnableMethod(
@@ -303,9 +303,9 @@
           reply_msg));
 }

-// Called on the IO thread.
 void RenderMessageFilter::OnClipboardReadAvailableTypes(
     ui::Clipboard::Buffer buffer, IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   BrowserThread::PostTask(
       BrowserThread::UI, FROM_HERE,
       NewRunnableMethod(
@@ -313,10 +313,10 @@
           reply_msg));
 }

-// Called on the IO thread.
 void RenderMessageFilter::OnClipboardReadData(ui::Clipboard::Buffer buffer,
                                               const string16& type,
                                               IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   BrowserThread::PostTask(
       BrowserThread::UI, FROM_HERE,
       NewRunnableMethod(
@@ -324,9 +324,9 @@
           reply_msg));
 }

-// Called on the IO thread.
 void RenderMessageFilter::OnClipboardReadFilenames(
     ui::Clipboard::Buffer buffer, IPC::Message* reply_msg) {
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
   BrowserThread::PostTask(
       BrowserThread::UI, FROM_HERE,
       NewRunnableMethod(


Add a missing head to fix touch compile.

BUG=none
TEST=compiles with touch
TBR=jam@chromium.org

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@86003 0039d316-1c4b-4281-b951-d872f2087c98

--- chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
+++ chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
@@ -18,6 +18,7 @@
 #include "content/browser/tab_contents/tab_contents_view.h"
 #include "content/common/notification_service.h"
 #include "content/common/notification_type.h"
+#include "content/common/view_messages.h"
 #include "ui/base/animation/slide_animation.h"
 #include "ui/gfx/rect.h"
 #include "ui/gfx/transform.h"


[rac] Fix the section container width: 440px

This patch changes the rac section container to be 440px. (Previously,
http://crrev.com/224301 has set the width to 420px.)

BUG=294467

Review URL: https://chromiumcodereview.appspot.com/23483057

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@224582 0039d316-1c4b-4281-b951-d872f2087c98

--- chrome/browser/ui/views/autofill/autofill_dialog_views.cc
+++ chrome/browser/ui/views/autofill/autofill_dialog_views.cc
@@ -70,7 +70,7 @@
 namespace {

 // The width for the section container.
-const int kSectionContainerWidth = 420;
+const int kSectionContainerWidth = 440;

 // The minimum useful height of the contents area of the dialog.
 const int kMinimumContentsHeight = 100;


Change std::min() to std::max() in GlassBrowserFrameView min size calculation.

I changed to std::min() from an if statement based on a review comment, but forgot to test. The correct code is to use std::max() here.

BUG=9885
TEST=manual

Review URL: http://codereview.chromium.org/7388014

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@92713 0039d316-1c4b-4281-b951-d872f2087c98

--- chrome/browser/ui/views/frame/glass_browser_frame_view.cc
+++ chrome/browser/ui/views/frame/glass_browser_frame_view.cc
@@ -170,7 +170,7 @@
     } else {
       int min_tabstrip_area_width =
           width() - GetBoundsForTabStrip(tabstrip).width() + min_tabstrip_width;
-      min_size.set_width(std::min(min_tabstrip_area_width, min_size.width()));
+      min_size.set_width(std::max(min_tabstrip_area_width, min_size.width()));
     }
   }


*Fixes #135: memory leak that was introduces Jun 17, 2017 in https://github.com/eidheim/Simple-Web-Server/commit/e1aebba3445bc42fe6b552b825ba9f4bda16d343

--- client_http.hpp
+++ client_http.hpp
@@ -93,6 +93,7 @@
                     query=std::unique_ptr<asio::ip::tcp::resolver::query>(new asio::ip::tcp::resolver::query(proxy_host_port.first, std::to_string(proxy_host_port.second)));
                 }
             }
+
             std::string host;
             unsigned short port;
             Config config;
@@ -161,16 +162,18 @@
         void request(const std::string &method, const std::string &path, string_view content, const CaseInsensitiveMultimap& header,
                      std::function<void(std::shared_ptr<Response>, const error_code&)> &&request_callback_) {
             auto session=std::make_shared<Session>(io_service, get_connection(), create_request_header(method, path, header));
+            auto connection=session->connection;
+            auto response=session->response;
             auto request_callback=std::make_shared<std::function<void(std::shared_ptr<Response>, const error_code&)>>(std::move(request_callback_));
             auto connections_mutex=this->connections_mutex;
-            session->callback=[session, request_callback, connections_mutex](const error_code &ec) {
+            session->callback=[connection, response, request_callback, connections_mutex](const error_code &ec) {
                 {
                     std::lock_guard<std::mutex> lock(*connections_mutex);
-                    session->connection->in_use=false;
+                    connection->in_use=false;
                 }

                 if(*request_callback)
-                    (*request_callback)(session->response, ec);
+                    (*request_callback)(response, ec);
             };

             std::ostream write_stream(session->request_buffer.get());
@@ -202,16 +205,18 @@
         void request(const std::string &method, const std::string &path, std::istream& content, const CaseInsensitiveMultimap& header,
                      std::function<void(std::shared_ptr<Response>, const error_code&)> &&request_callback_) {
             auto session=std::make_shared<Session>(io_service, get_connection(), create_request_header(method, path, header));
+            auto connection=session->connection;
+            auto response=session->response;
             auto request_callback=std::make_shared<std::function<void(std::shared_ptr<Response>, const error_code&)>>(std::move(request_callback_));
             auto connections_mutex=this->connections_mutex;
-            session->callback=[session, request_callback, connections_mutex](const error_code &ec) {
+            session->callback=[connection, response, request_callback, connections_mutex](const error_code &ec) {
                 {
                     std::lock_guard<std::mutex> lock(*connections_mutex);
-                    session->connection->in_use=false;
+                    connection->in_use=false;
                 }

                 if(*request_callback)
-                    (*request_callback)(session->response, ec);
+                    (*request_callback)(response, ec);
             };

             content.seekg(0, std::ios::end);


fix the message of config for max_connections.

--- trunk/src/app/srs_app_config.cpp
+++ trunk/src/app/srs_app_config.cpp
@@ -1502,9 +1502,9 @@
                 "total=%d(max_connections=%d, nb_consumed_fds=%d), ret=%d. "
                 "you can change max_connections from %d to %d, or "
                 "you can login as root and set the limit: ulimit -HSn %d",
-                nb_connections, nb_total, max_open_files,
+                nb_connections, nb_total + 1, max_open_files,
                 nb_total, nb_connections, nb_consumed_fds,
-                ret, nb_connections, nb_canbe, nb_total);
+                ret, nb_connections, nb_canbe, nb_total + 1);
             return ret;
         }
     }


FIX: avoid division by zero

FIX: avoid division by zero

--- cpp/Tests/TestsSmurff.cpp
+++ cpp/Tests/TestsSmurff.cpp
@@ -70,7 +70,12 @@
 void checkValue(double actualValue, double expectedValue, double epsilon)
 {
 #ifdef _OPENMP
-   CHECK((std::abs(actualValue - expectedValue) / std::max(actualValue, expectedValue)) < 10.);
+   double abs_max = std::max(std::abs(actualValue), std::abs(expectedValue));
+
+   if (abs_max > 0)
+        CHECK((std::abs(actualValue - expectedValue) / abs_max) < 10.);
+   else
+        CHECK(std::abs(actualValue - expectedValue) < 10.);
 #else
   CHECK(actualValue == Approx(expectedValue).epsilon(epsilon));
 #endif


Various bug fixes.

Various bug fixes.

--- cpp/mysql_diff_schemas.cc
+++ cpp/mysql_diff_schemas.cc
@@ -59,10 +59,13 @@
         ++cp;
     if (unlikely(cp == end))
         return "";
+    ++cp; // Skip over the opening backtick.

     std::string quoted_text;
-    while (*cp != '`')
+    while (cp != end and *cp != '`')
         quoted_text += *cp++;
+    if (unlikely(cp == end))
+        return "";
     ++cp; // Skip over the closing backtick.

     return quoted_text;
@@ -113,7 +116,12 @@
                                                             : line.substr(__builtin_strlen("CREATE VIEW ")));
             current_schema.clear();
         } else if (line_starts_with_create_trigger) {
-            current_table_or_view.clear();
+            if (not current_schema.empty()) {
+                std::sort(current_schema.begin(), current_schema.end(), SchemaLineIsLessThan);
+                (*table_or_view_name_to_schema_map)[current_table_or_view] = current_schema;
+                current_table_or_view.clear();
+                current_schema.clear();
+            }
             triggers->emplace_back(line);
         } else {
             if (line[line.length() - 1] == ',')
@@ -310,12 +318,12 @@
         ExtractTriggerNameAndTable(*trigger2, &name2, &table2);

         if (name1 == name2 and table1 == table2) {
-            ++trigger1, ++trigger2;
             if (*trigger1 != *trigger2) {
                 std::cout << "Triggers w/ same name and same tables differ:\n"
                           << '\t' << *trigger1 << '\n'
                           << '\t' << *trigger2 << '\n';
             }
+            ++trigger1, ++trigger2;
         } else if (name1 + table1 < name2 + table2) {
             std::cout << "Trigger is present in the 1st schema but missing in the 2nd schema: " << *trigger1 << '\n';
             ++trigger1;


added cleanup of equal column charset before comparing

--- cpp/mysql_diff_schemas.cc
+++ cpp/mysql_diff_schemas.cc
@@ -153,7 +153,8 @@
             if (table_definition.find(default_char_set) != table_definition.npos) {
                 table_char_set = table_definition.substr(table_definition.find(default_char_set) + default_char_set.length());
                 size_t split_pos = table_char_set.find(' ');
-                table_char_set = table_char_set.substr(0,split_pos);
+                if (split_pos != table_char_set.npos)
+                    table_char_set = table_char_set.substr(0, split_pos);
             }
         }
         if (not table_char_set.empty()) {
@@ -163,7 +164,8 @@
                 if (char_set_pos != table_definition.npos) {
                     column_char_set = table_definition.substr(table_definition.find(char_set) + char_set.length());
                     size_t split_pos = column_char_set.find(' ');
-                    column_char_set = column_char_set.substr(0,split_pos);
+                    if (split_pos != column_char_set.npos)
+                        column_char_set = column_char_set.substr(0, split_pos);
                     if (table_char_set == column_char_set) {
                         table_definition.erase(char_set_pos, char_set.length() + 1 + column_char_set.length());
                         erasing_done = true;


INTEGRATION: CWS changefileheader (1.5.118); FILE MERGED 2008/04/01 16:02:21 thb 1.5.118.3: #i85898# Stripping all external header guards 2008/04/01 12:58:20 thb 1.5.118.2: #i85898# Stripping all external header guards 2008/03/31 15:30:26 rt 1.5.118.1: #i87441# Change license header to LPGL v3.

--- ucb/source/ucp/odma/odma_lib.cxx
+++ ucb/source/ucp/odma/odma_lib.cxx
@@ -1,35 +1,30 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  $RCSfile: odma_lib.cxx,v $
+ * Copyright 2008 by Sun Microsystems, Inc.
  *
- *  $Revision: 1.5 $
+ * OpenOffice.org - a multi-platform office productivity suite
  *
- *  last change: $Author: obo $ $Date: 2006-09-17 13:58:10 $
+ * $RCSfile: odma_lib.cxx,v $
+ * $Revision: 1.6 $
  *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
+ * This file is part of OpenOffice.org.
  *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
  *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
  *
- *    This library is free software; you can redistribute it and/or
- *    modify it under the terms of the GNU Lesser General Public
- *    License version 2.1, as published by the Free Software Foundation.
- *
- *    This library is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *    Lesser General Public License for more details.
- *
- *    You should have received a copy of the GNU Lesser General Public
- *    License along with this library; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *    MA  02111-1307  USA
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
  *
  ************************************************************************/

@@ -38,15 +33,9 @@
 //#ifndef _OSL_PROCESS_H_
 //#include <osl/process.h>
 //#endif
-#ifndef _OSL_MODULE_H_
 #include <osl/module.h>
-#endif
-#ifndef _RTL_USTRING_HXX_
 #include <rtl/ustring.hxx>
-#endif
-#ifndef ODMA_LIB_HXX
 #include "odma_lib.hxx"
-#endif

 namespace odma


Got rid of the popup spinner's square container by setting translucent background attribute.

--- QtWaitingSpinner.cpp
+++ QtWaitingSpinner.cpp
@@ -79,6 +79,7 @@
   // widget for the first time since changing this property while
   // the widget is visible has no effect.
   this->setWindowModality(modality);
+  this->setAttribute(Qt::WA_TranslucentBackground);
 }

 /*----------------------------------------------------------------------------*/


Unbreak the build. Fallout from r170019.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@170033 91177308-0d34-0410-b5e6-96231b3b80d8

--- unittests/Support/YAMLIOTest.cpp
+++ unittests/Support/YAMLIOTest.cpp
@@ -552,7 +552,7 @@
     }

     static StringRef input(StringRef scalar, void *, MyNumber &value) {
-      int64_t n;
+      long long n;
       if ( getAsSignedInteger(scalar, 0, n) )
         return "invalid number";
       value = n;


fix some unit tests for eosio.system

fix some unit tests for eosio.system

--- unittests/eosio.system_tests.cpp
+++ unittests/eosio.system_tests.cpp
@@ -108,6 +108,7 @@
                                             ("receiver", a)
                                             ("stake_net_quantity", "10.0000 EOS" )
                                             ("stake_cpu_quantity", "10.0000 EOS" )
+                                            ("transfer", 0 )
                                           )
                                 );

@@ -150,6 +151,7 @@
                                             ("receiver", a)
                                             ("stake_net_quantity", net )
                                             ("stake_cpu_quantity", cpu )
+                                            ("transfer", 0 )
                                           )
                                 );

@@ -196,6 +198,7 @@
                                                ("receiver", a)
                                                ("stake_net_quantity", net)
                                                ("stake_cpu_quantity", cpu )
+                                            ("transfer", 0 )
                                                )
                                    );
       }
@@ -233,6 +236,7 @@
                           ("receiver", to)
                           ("stake_net_quantity", net)
                           ("stake_cpu_quantity", cpu)
+                                            ("transfer", 0 )
       );
    }

@@ -496,8 +500,8 @@
                                     ("receiver", "bob")
                                     ("stake_net_quantity", "10.0000 EOS")
                                     ("stake_cpu_quantity", "10.0000 EOS")
-                                    ("stake_ram_quantity", "10.0000 EOS"),
-                                    false
+                                    ("transfer", 0 )
+                                    ,false
                         )
    );

@@ -507,6 +511,7 @@
                                     ("receiver", "bob")
                                     ("unstake_net_quantity", "200.0000 EOS")
                                     ("unstake_cpu_quantity", "100.0000 EOS")
+                                    ("transfer", 0 )
                                     ,false
                         )
    );
@@ -1088,6 +1093,7 @@
    //register proxy by first action for this user ever
    BOOST_REQUIRE_EQUAL( success(), push_action(N(alice), N(regproxy), mvo()
                                                ("proxy",  "alice")
+                                               ("isproxy", true )
                         )
    );
    REQUIRE_MATCHING_OBJECT( proxy( "alice" ), get_voter_info( "alice" ) );
@@ -1108,7 +1114,7 @@
                                                ("isproxy", true)
                         )
    );
-   REQUIRE_MATCHING_OBJECT( proxy( "bob" )( "staked", "300.0003 EOS" ), get_voter_info( "bob" ) );
+   REQUIRE_MATCHING_OBJECT( proxy( "bob" )( "staked", 3000003 ), get_voter_info( "bob" ) );
    //unrgister and check that stake is still in place
    BOOST_REQUIRE_EQUAL( success(), push_action( N(bob), N(regproxy), mvo()
                                                ("proxy",  "bob")
@@ -1783,11 +1789,13 @@
    //alice becomes a proxy
    BOOST_REQUIRE_EQUAL( success(), push_action( N(alice), N(regproxy), mvo()
                                                 ("proxy",  "alice")
+                                                ("isproxy",  1)
                         )
    );
    issue( "alice", "1000.0000 EOS",  config::system_account_name );
    BOOST_REQUIRE_EQUAL( success(), stake( "alice", "5.0000 EOS", "5.0000 EOS" ) );
-   REQUIRE_MATCHING_OBJECT( proxy( "alice" )( "staked", "10.0000 EOS" ), get_voter_info( "alice" ) );
+   edump((get_voter_info("alice")));
+   REQUIRE_MATCHING_OBJECT( proxy( "alice" )( "staked", 100000 ), get_voter_info( "alice" ) );

    //bob stakes and selects alice as a proxy
    issue( "bob", "1000.0000 EOS",  config::system_account_name );
@@ -1798,30 +1806,33 @@
                                                 ("producers", vector<account_name>() )
                         )
    );
-   REQUIRE_MATCHING_OBJECT( proxy( "alice" )( "proxied_votes", 1500003 )( "staked", "10.0000 EOS" ), get_voter_info( "alice" ) );
+   REQUIRE_MATCHING_OBJECT( proxy( "alice" )( "proxied_votes", 1500003 )( "staked", 100000 ), get_voter_info( "alice" ) );

    //double regestering should fail without affecting total votes and stake
    BOOST_REQUIRE_EQUAL( error( "condition: assertion failed: account is already a proxy" ),
                         push_action( N(alice), N(regproxy), mvo()
                                      ("proxy",  "alice")
-                        )
-   );
-   REQUIRE_MATCHING_OBJECT( proxy( "alice" )( "proxied_votes", 1500003 )( "staked", "10.0000 EOS" ), get_voter_info( "alice" ) );
+                                     ("isproxy",  1)
+                        )
+   );
+   REQUIRE_MATCHING_OBJECT( proxy( "alice" )( "proxied_votes", 1500003 )( "staked", 100000 ), get_voter_info( "alice" ) );

    //uregister
    BOOST_REQUIRE_EQUAL( success(), push_action( N(alice), N(unregproxy), mvo()
                                                 ("proxy",  "alice")
-                        )
-   );
-   REQUIRE_MATCHING_OBJECT( voter( "alice" )( "proxied_votes", 1500003 )( "staked", "10.0000 EOS" ), get_voter_info( "alice" ) );
+                                                ("isproxy",  0)
+                        )
+   );
+   REQUIRE_MATCHING_OBJECT( voter( "alice" )( "proxied_votes", 1500003 )( "staked", 100000 ), get_voter_info( "alice" ) );

    //double unregistering should not affect proxied_votes and stake
    BOOST_REQUIRE_EQUAL( error( "condition: assertion failed: account is not a proxy" ),
                         push_action( N(alice), N(unregproxy), mvo()
                                      ("proxy",  "alice")
-                        )
-   );
-   REQUIRE_MATCHING_OBJECT( voter( "alice" )( "proxied_votes", 1500003 )( "staked", "10.0000 EOS" ), get_voter_info( "alice" ) );
+                                     ("isproxy",  0)
+                        )
+   );
+   REQUIRE_MATCHING_OBJECT( voter( "alice" )( "proxied_votes", 1500003 )( "staked", 100000 ), get_voter_info( "alice" ) );

 } FC_LOG_AND_RETHROW()

@@ -1830,12 +1841,14 @@
    //alice becomes a proxy
    BOOST_REQUIRE_EQUAL( success(), push_action( N(alice), N(regproxy), mvo()
                                                 ("proxy",  "alice")
+                                                ("isproxy",  1)
                         )
    );

    //bob becomes a proxy
    BOOST_REQUIRE_EQUAL( success(), push_action( N(bob), N(regproxy), mvo()
                                                 ("proxy",  "bob")
+                                                ("isproxy",  1)
                         )
    );
    //proxy should not be able to use a proxy
@@ -1861,6 +1874,7 @@
    BOOST_REQUIRE_EQUAL( error( "condition: assertion failed: account that uses a proxy is not allowed to become a proxy" ),
                         push_action( N(carol), N(regproxy), mvo()
                                      ("proxy",  "carol")
+                                     ("isproxy",  1)
                         )
    );


Define return value for host xattr

Define return value for host xattr

--- cvmfs/publish/settings.cc
+++ cvmfs/publish/settings.cc
@@ -461,10 +461,10 @@
     session_dir);

   std::string xattr;
-  bool rvb = platform_getxattr(
+  bool is_roothash_present = platform_getxattr(
     settings_publisher->transaction().spool_area().readonly_mnt(),
     "user.root_hash", &xattr);
-  if (!rvb) {
+  if (!is_roothash_present) {
     throw EPublish("cannot get extrended attribute root_hash");
   }

@@ -474,10 +474,10 @@
                  false /* external */);

   std::string arg;
-  rvb = platform_getxattr(
+  bool is_host_present = platform_getxattr(
     settings_publisher->transaction().spool_area().readonly_mnt(),
     "user.host", &arg);
-  if (!rvb) {
+  if (!is_host_present) {
     throw EPublish("cannot get extended attribute host");
   } else {
     settings_publisher->SetUrl(arg);


Removed unnecessary include of StringTools.h.

--- util/cpp/db/util/Base64Codec.cpp
+++ util/cpp/db/util/Base64Codec.cpp
@@ -1,8 +1,7 @@
 /*
- * Copyright (c) 2007 Digital Bazaar, Inc.  All rights reserved.
+ * Copyright (c) 2007-2008 Digital Bazaar, Inc.  All rights reserved.
  */
 #include "db/util/Base64Codec.h"
-#include "db/util/StringTools.h"

 using namespace std;
 using namespace db::util;


half assed attempt at making doWho more crashproof

--- code/cmd_who.cc
+++ code/cmd_who.cc
@@ -137,222 +137,9 @@

 void TBeing::doWho(const char *argument)
 {
-  // New Who Code to handle: who -ol j 20 40
-
-#if 0
-  if (gamePort == BETA_GAMEPORT) {
-    // 28 Who Flags upon ( 4-14-00):
-    //  i=Idle          l=Levels        q=Quests
-    //  h=Hit/Mana/Move z=Seeks-Group   p=Grouped
-    //  d=Linkdead      g=Gods/Creators b=Builders/Gods/Creators
-    //  o=Mortals       s=Stats         f=Faction
-    //  1=Mage          2=Cleric        3=Warrior
-    //  4=Thief         5=Deikhan       6=Monk
-    //  7=Ranger        8=Shaman        e=Elf
-    //  t=Hobbit        n=Gnome         u=Human
-    //  r=Ogre          w=Dwarven       y=Not-Grouped
-    //  a=Account Name  x=perma death
-    const  char *tPerfMatches = "ilqhzpydgbosf12345678etnurwax";
-    char   tString[256],
-           tBuffer[256]  = "\0",
-           tOutput[1024] = "\0";
-    int    tLow   =  0,
-           tHigh  = 60,
-           tCount =  0,
-           tLinkD =  0;
-    string tSb("");
-    unsigned long int tBits = 0;
-    TBeing *tBeing;
-      //           *tFollower;
-
-    while ((argument = one_argument(argument, tString))) {
-      if (tString[0] == '-') {
-        for (const char *tMarker = (tString + 1); *tMarker; tMarker++)
-          if (strchr(tPerfMatches, *tMarker))
-            tBits |= (1 << (strchr(tPerfMatches, *tMarker) - tPerfMatches));
-          else {
-            if (*tMarker != '?') {
-              sprintf(tBuffer, "Unknown Option '%c':\n\r", *tMarker);
-              tSb += tBuffer;
-            }
-
-            if (isImmortal()) {
-              tSb += "[-] [i]idle [l]levels [q]quests [h]hit/mana/move/lf\n\r";
-              tSb += "[-] [z]seeks-group [p]groups [y]currently-not-grouped\n\r";
-              tSb += "[-] [d]linkdead [g]God [b]Builders [o]Mort [s]stats [f]action\n\r";
-              tSb += "[-] [1]Mage[2]Cleric[3]War[4]Thief[5]Deikhan[6]Monk[7]Ranger[8]Shaman\n\r";
-              tSb += "[-] [e]elf [t]hobbit [n]gnome [u]human [r]ogre [w]dwarven\n\r";
-              tSb += "[-] [x]Perma Death\n\r";
-
-              if (hasWizPower(POWER_WIZARD))
-                tSb += "[-] [a]ccount\n\r";
-
-              tSb += "\n\r";
-            } else {
-              tSb += "[-] [q]quests [g]god [b]builder [o]mort [f]faction\n\r";
-              tSb += "[-] [z]seeks-group [p]groups [y]currently-not-grouped\n\r";
-              tSb += "[-] [e]elf [t]hobbit [n]gnome [u]human [r]ogre [w]dwarven\n\r\n\r";
-              tSb += "[-] [1]Mage[2]Cleric[3]War[4]Thief[5]Deikhan[6]Monk[7]Ranger[8]Shaman\n\r";
-              tSb += "[-] [x]Perma Death\n\r";
-            }
-
-            if (desc)
-              desc->page_string(tSb.c_str(), SHOWNOW_NO, ALLOWREP_YES);
-
-            return;
-          }
-      } else if (is_number(tBuffer)) {
-        if (!tLow)
-          tLow = atoi(tBuffer);
-        else
-          tHigh = atoi(tBuffer);
-
-	if (tLow <= 0 || tHigh > 60) {
-          sendTo("Level numbers must be between 1 and 60.\n\r");
-          return;
-        }
-
-        if (tHigh < tLow) {
-          tCount = tLow;
-          tLow   = tHigh;
-          tHigh  = tCount;
-        }
-      } else
-        strcpy(tBuffer, tString);
-    }
-
-    tSb += "Players: (Use who -? for online help)\n\r----------\n\r";
-    tCount = tLinkD = 0;
-
-    for (tBeing = character_list; tBeing; tBeing = tBeing->next)
-      if (tBeing->isPc() && (tBeing->polyed == POLY_TYPE_NONE || isImmortal()) &&
-          dynamic_cast<TPerson *>(tBeing) && canSeeWho(tBeing)) {
-        if (tBeing->isLinkdead())
-          tLinkD++;
-        else
-          tCount++;
-
-        bool anonCheck = (isImmortal() || !tBeing->isPlayerAction(PLR_ANONYMOUS));
-
-        if ((!(tBits & (1 <<  2)) || tBeing->inQuest()) &&
-            (!(tBits & (1 <<  4)) || tBeing->isPlayerAction(PLR_SEEKSGROUP)) &&
-            (!(tBits & (1 <<  5)) || (tBeing->isAffected(AFF_GROUP) && !tBeing->master && tBeing->followers)) &&
-            (!(tBits & (1 <<  6)) || (!tBeing->isAffected(AFF_GROUP) && !tBeing->isImmortal())) &&
-            (!(tBits & (1 <<  7)) || (tBeing->isLinkdead() && isImmortal())) &&
-            (!(tBits & (1 <<  8)) || tBeing->hasWizPower(POWER_GOD)) &&
-            (!(tBits & (1 <<  9)) || tBeing->hasWizPower(POWER_BUILDER)) &&
-            (!(tBits & (1 << 10)) || !tBeing->hasWizPower(POWER_BUILDER)) &&
-            (!(tBits & (1 << 13)) || (anonCheck && tBeing->hasClass(CLASS_MAGE))) &&
-            (!(tBits & (1 << 14)) || (anonCheck && tBeing->hasClass(CLASS_CLERIC))) &&
-            (!(tBits & (1 << 15)) || (anonCheck && tBeing->hasClass(CLASS_WARRIOR))) &&
-            (!(tBits & (1 << 16)) || (anonCheck && tBeing->hasClass(CLASS_THIEF))) &&
-            (!(tBits & (1 << 17)) || (anonCheck && tBeing->hasClass(CLASS_DEIKHAN))) &&
-            (!(tBits & (1 << 18)) || (anonCheck && tBeing->hasClass(CLASS_MONK))) &&
-            (!(tBits & (1 << 19)) || (anonCheck && tBeing->hasClass(CLASS_RANGER))) &&
-            (!(tBits & (1 << 20)) || (anonCheck && tBeing->hasClass(CLASS_SHAMAN))) &&
-            (!(tBits & (1 << 21)) || tBeing->getRace() == RACE_ELVEN) &&
-            (!(tBits & (1 << 22)) || tBeing->getRace() == RACE_GNOME) &&
-            (!(tBits & (1 << 23)) || tBeing->getRace() == RACE_HUMAN) &&
-            (!(tBits & (1 << 24)) || tBeing->getRace() == RACE_DWARF) &&
-            (!(tBits & (1 << 25)) || tBeing->getRace() == RACE_OGRE) &&
-            (!(tBits & (1 << 26)) || tBeing->getRace() == RACE_HOBBIT) &&
-	    (!(tBits & (1 << 28)) || tBeing->hasQuestBit(TOG_PERMA_DEATH_CHAR) &&
-            (!*tBuffer || is_abbrev(tBuffer, tBeing->getName())) &&
-            in_range(tBeing->GetMaxLevel(), tLow, tHigh)) {
-          tOutput[0] = '\0';
-
-	  if(tBeing->hasQuestBit(TOG_PERMA_DEATH_CHAR)){
-	    vlogf(LOG_PEEL, "%s has bit", tBeing->name);
-	  } else {
-	    vlogf(LOG_PEEL, "%s does not have bit", tBeing->name);
-	  }
-
-
-          if ((tBits & (1 << 0)) && isImmortal()) {
-            sprintf(tString, "Idle:[%-3d] ", tBeing->getTimer());
-            strcat(tOutput, tString);
-          }
-
-          if ((tBits & (1 << 1)))
-            strcat(tOutput, getWhoLevel(this, tBeing).c_str());
-
-          if (tBeing->isLinkdead())
-            sprintf(tString, "[%-12s]", pers(tBeing));
-          else if (tBeing->polyed == POLY_TYPE_SWITCH)
-            sprintf(tString, "[%-12s] (switched)", pers(tBeing));
-          else if (dynamic_cast<TMonster *>(tBeing) &&
-                   (tBeing->specials.act & ACT_POLYSELF))
-            sprintf(tString, "(%-12s)", pers(tBeing));
-          else
-            sprintf(tString, "%-14s", pers(tBeing));
-
-          strcat(tOutput, tString);
-	  // Name goes here.
-
-          if ((tBits & (1 << 12))) {
-            if ((isImmortal() || getFaction() == tBeing->getFaction()) && !tBeing->isImmortal())
-#if FACTIONS_IN_USE
-              sprintf(tString, " [%s] %5.2f%%",
-                      FactionInfo[tBeing->getFaction()].faction_name,
-                      tBeing->getPerc());
-#else
-              sprintf(tString, " [%s]",
-                      FactionInfo[tBeing->getFaction()].faction_name);
-#endif
-
-            strcat(tOutput, tString);
-          }
-
-          if ((tBits & (1 << 3)) && isImmortal()) {
-            if (tBeing->hasClass(CLASS_CLERIC) || tBeing->hasClass(CLASS_DEIKHAN))
-              sprintf(tString, "\n\r\tHit:[%-3d] Pty:[%-5.2f] Move:[%-3d] Talens:[%-8d] Bank:[%-8d]",
-                      tBeing->getHit(), tBeing->getPiety(), tBeing->getMove(), tBeing->getMoney(), tBeing->getBank());
-            else if (tBeing->hasClass(CLASS_SHAMAN))
-              sprintf(tString, "\n\r\tHit:[%-3d] Pty:[%-4d] Move:[%-3d] Talens:[%-8d] Bank:[%-8d]",
-                      tBeing->getHit(), tBeing->getLifeforce(), tBeing->getMove(), tBeing->getMoney(), tBeing->getBank());
-            else
-              sprintf(tString, "\n\r\tHit:[%-3d] Mna:[%-3d] Move:[%-3d] Talens:[%-8d] Bank:[%-8d]",
-                      tBeing->getHit(), tBeing->getMana(), tBeing->getMove(), tBeing->getMoney(), tBeing->getBank());
-
-            strcat(tOutput, tString);
-          }
-
-          if ((tBits & (1 << 27)) && isImmortal() &&
-              hasWizPower(POWER_WIZARD)) {
-            if (tBeing->desc && tBeing->desc->account)
-              sprintf(tString, " Account[%s]", tBeing->desc->account->name);
-            else
-              sprintf(tString, " Account[Unknown]");
-
-            strcat(tOutput, tString);
-          }
-
-          if ((tBits & (1 << 11)) && isImmortal()) {
-            sprintf(tString, "\n\r\t[St:%-3d Br:%-3d Co:%-3d De:%-3d Ag:%-3d In:%-3d Wi:%-3d Fo:%-3d Pe:%-3d Ch:%-3d Ka:%-3d Sp:%-3d]",
-                    tBeing->curStats.get(STAT_STR),
-                    tBeing->curStats.get(STAT_BRA),
-                    tBeing->curStats.get(STAT_CON),
-                    tBeing->curStats.get(STAT_DEX),
-                    tBeing->curStats.get(STAT_AGI),
-                    tBeing->curStats.get(STAT_INT),
-                    tBeing->curStats.get(STAT_WIS),
-                    tBeing->curStats.get(STAT_FOC),
-                    tBeing->curStats.get(STAT_PER),
-                    tBeing->curStats.get(STAT_CHA),
-                    tBeing->curStats.get(STAT_KAR),
-                    tBeing->curStats.get(STAT_SPE));
-
-            strcat(tOutput, tString);
-          }
-        }
-      }
-
-    return;
-  }
-#endif
-
   TBeing *k, *p;
   char buf[1024] = "\0\0\0";
+  string bufstr;
   int listed = 0, lcount, l;
   unsigned int count;
   char arg[1024], tempbuf[1024];
@@ -381,33 +168,33 @@
             count++;

             p->parseTitle(buf, desc);
+	    bufstr=buf;
             if (!*argument) {
               if (p->isPlayerAction(PLR_SEEKSGROUP))
-                sprintf(buf + strlen(buf), "   (Seeking Group)");
+		bufstr += "   (Seeking Group)";

               if (p->isPlayerAction(PLR_NEWBIEHELP))
-                sprintf(buf + strlen(buf), "   (Newbie-Helper)");
-
-              strcat(buf, "\n\r");
+		bufstr += "   (Newbie-Helper)";
+
+	      bufstr += "\n\r";
             } else {
-              sprintf(buf + strlen(buf), "   %s", getWhoLevel(this, p).c_str());
+	      bufstr += "   " + getWhoLevel(this, p);
+
               if (p->isPlayerAction(PLR_SEEKSGROUP))
-                sprintf(buf + strlen(buf), "   (Seeking Group)");
+		bufstr += "   (Seeking Group)";

               if (p->isPlayerAction(PLR_NEWBIEHELP))
-                sprintf(buf + strlen(buf), "   (Newbie-Helper)");
-
-              sprintf(buf + strlen(buf), "\n\r");
+		bufstr += "   (Newbie-Helper)";
+
+	      bufstr += "\n\r";
             }
-            char tmp[256];
+
             if (isImmortal() && p->isLinkdead()) {
-              sprintf(tmp, "** %s", buf);
             } else {
-              sprintf(tmp, "%s%s",
-                  (p->polyed == POLY_TYPE_SWITCH ?  "(switched) " : ""), buf);
-              sb += tmp;
+              snprintf(tempbuf, 1023, "%s%s",
+                  (p->polyed == POLY_TYPE_SWITCH ?  "(switched) " : ""), bufstr.c_str());
+              sb += tempbuf;
             }
-            //            sb += tmp;
           }
         } else if (isImmortal()) {
 // only immortals will see this to provide them some concealment
@@ -416,23 +203,23 @@
                 (p->GetMaxLevel() >= which1 && p->GetMaxLevel() <= which2)) &&
               IS_SET(p->specials.act, ACT_POLYSELF)) {
             count++;
-            strcpy(tempbuf, pers(p));
-            sprintf(buf, "%s (polymorphed)\n\r", cap(tempbuf));
+            strncpy(tempbuf, pers(p), 1023);
+            snprintf(buf, 1023, "%s (polymorphed)\n\r", cap(tempbuf));
             sb += buf;
           } else if (canSeeWho(p) &&
                 (!*argument ||
                 (p->GetMaxLevel() >= which1 && p->GetMaxLevel() <= which2)) &&
                      IS_SET(p->specials.act, ACT_DISGUISED)) {
             count++;
-            strcpy(tempbuf, pers(p));
-            sprintf(buf, "%s (disguised thief)\n\r", cap(tempbuf));
+            strncpy(tempbuf, pers(p), 1023);
+            snprintf(buf, 1023, "%s (disguised thief)\n\r", cap(tempbuf));
             sb += buf;
           }
         }
       }
     }
     accStat.max_player_since_reboot = max(accStat.max_player_since_reboot, count);
-    sprintf(buf, "\n\rTotal Players : [%d] Max since last reboot : [%d] Avg Players : [%.1f]\n\r", count, accStat.max_player_since_reboot, stats.useage_iters ? (float) stats.num_users / stats.useage_iters : 0);
+    snprintf(buf, 1023, "\n\rTotal Players : [%d] Max since last reboot : [%d] Avg Players : [%.1f]\n\r", count, accStat.max_player_since_reboot, stats.useage_iters ? (float) stats.num_users / stats.useage_iters : 0);
     sb += buf;
     if (desc)
       desc->page_string(sb.c_str(), SHOWNOW_NO, ALLOWREP_YES);
@@ -498,14 +285,14 @@
               (!strchr(arg, 't') || p->getRace() == RACE_HOBBIT) &&
 	      (!strchr(arg, 'x') || p->hasQuestBit(TOG_PERMA_DEATH_CHAR)))) {
             if (p->isLinkdead() && isImmortal())
-              sprintf(buf, "[%-12s] ", pers(p));
+              snprintf(buf, 1023, "[%-12s] ", pers(p));
             else if (p->polyed == POLY_TYPE_SWITCH && isImmortal())
-              sprintf(buf, "[%-12s] (switched) ", pers(p));
+              snprintf(buf, 1023, "[%-12s] (switched) ", pers(p));
             else if (dynamic_cast<TMonster *>(p) &&
                      (p->specials.act & ACT_POLYSELF))
-              sprintf(buf, "(%-14s) ", pers(p));
+              snprintf(buf, 1023, "(%-14s) ", pers(p));
             else
-              sprintf(buf, "%-11s ", pers(p));
+              snprintf(buf, 1023, "%-11s ", pers(p));
             listed++;
             for (l = 1; l <= (int) strlen(arg); l++) {
               switch (arg[l]) {
@@ -521,16 +308,16 @@
                       if (!canSeeWho(ch))
                         continue;
                       if (ch->isLinkdead() && isImmortal())
-                        sprintf(buf, "[%-12s] ", pers(ch));
+                        snprintf(buf, 1023, "[%-12s] ", pers(ch));
                       else if (ch->polyed == POLY_TYPE_SWITCH && isImmortal())
-                        sprintf(buf, "[%-12s] (switched) ", pers(ch));
+                        snprintf(buf, 1023, "[%-12s] (switched) ", pers(ch));
                       else if (dynamic_cast<TMonster *>(ch) &&
                                (ch->specials.act & ACT_POLYSELF))
-                        sprintf(buf + strlen(buf), "(%-14s) ", pers(ch));
+                        snprintf(buf + strlen(buf), 1023-strlen(buf), "(%-14s) ", pers(ch));
                       else if (ch->isPlayerAction(PLR_ANONYMOUS) && !isImmortal())
-                        sprintf(buf + strlen(buf), "%-11s (???) ", pers(ch));
+                        snprintf(buf + strlen(buf), 1023-strlen(buf), "%-11s (???) ", pers(ch));
                       else
-                        sprintf(buf + strlen(buf), "%-11s (L%d) ", pers(ch), ch->GetMaxLevel());
+                        snprintf(buf + strlen(buf), 1023-strlen(buf), "%-11s (L%d) ", pers(ch), ch->GetMaxLevel());
                     }

                     group = true;
@@ -539,19 +326,19 @@
                 case 'i':
                   if (!idle) {
                     if (isImmortal())
-                      sprintf(buf + strlen(buf), "Idle:[%-3d] ", p->getTimer());
+                      snprintf(buf + strlen(buf), 1023-strlen(buf), "Idle:[%-3d] ", p->getTimer());
                   }
                   idle = TRUE;
                   break;
                 case 'l':
                 case 'y':
                   if (!level) {
-                    strcat(buf, getWhoLevel(this, p).c_str());
+                    strncat(buf, getWhoLevel(this, p).c_str(), 1023-strlen(buf));
                     if (p->isPlayerAction(PLR_SEEKSGROUP))
-                      sprintf(buf + strlen(buf), "   (Seeking Group)");
+                      snprintf(buf + strlen(buf), 1023-strlen(buf), "   (Seeking Group)");

                     if (p->isPlayerAction(PLR_NEWBIEHELP))
-                      sprintf(buf + strlen(buf), "   (Newbie-Helper)");
+                      snprintf(buf + strlen(buf), 1023-strlen(buf), "   (Newbie-Helper)");
                   }
                   level = TRUE;
                   break;
@@ -561,7 +348,7 @@
                   // only a god can go invis, mortals technically have
                   // invisLevel if they are linkdead, ignore that though
                   if (p->getInvisLevel() > MAX_MORT)
-                    sprintf(buf + strlen(buf), "  (invis %d)  ",
+                    snprintf(buf + strlen(buf), 1023-strlen(buf), "  (invis %d)  ",
                         p->getInvisLevel());
                   break;
                 case 'h':


git-svn-id: svn+ssh://elmi.iti.uni-luebeck.de/export/svn/Hanse/trunk@414 8f13a6d9-6203-4c43-9b9f-a3039379152f

--- Hanse/Behaviour_PipeFollowing/behaviour_pipefollowing.cpp
+++ Hanse/Behaviour_PipeFollowing/behaviour_pipefollowing.cpp
@@ -661,7 +661,7 @@
     int sum;
     this->countPixel(gray,sum);

-    if(sum > 12000)
+    if( sum > 10000 )
     {
         noPipeCnt = 0;
         data["pipe_area"] = sum;


Fixed warning about tabs vs spaces

Fixed warning about tabs vs spaces

--- code/Examples/RJObject_GalaxyField/MyConditionalPrior.cpp
+++ code/Examples/RJObject_GalaxyField/MyConditionalPrior.cpp
@@ -75,7 +75,7 @@
 // x, y, flux, radius, q, theta, rinner/router, Minner/Mtotal
 double MyConditionalPrior::log_pdf(const std::vector<double>& vec) const
 {
-	double logp = 0.0;
+    double logp = 0.0;

     // Position
     if(vec[0] < x_min || vec[0] > x_max || vec[1] < y_min || vec[1] > y_max)
@@ -105,7 +105,7 @@
     if(vec[7] < 0.0 || vec[7] > 1.0)
         return -1E300;

-	return logp;
+    return logp;
 }

 void MyConditionalPrior::from_uniform(std::vector<double>& vec) const


Forward port of CVS commit by kloecker:

Forward port of CVS commit by kloecker:

Fix broken order of folders in the folder combobox. Since we now allow subfolders below the system folders we can't simply move the system folders to the begin of the list. Therefore we now leave the system folders where they are. Additionally, the local folders are now listed before the IMAP folders which should have always been the case.

This is only a temporary fix. I plan to get rid of the hard-to-use-with-many-folders-and-accounts combobox in favor of the nice folder selection dialog.

svn path=/trunk/kdepim/; revision=361213

--- kmail/kmfoldercombobox.cpp
+++ kmail/kmfoldercombobox.cpp
@@ -33,14 +33,14 @@
   mOutboxShown = true;
   mImapShown = true;
   refreshFolders();
-  connect( this, SIGNAL( activated(int) ),
+  connect( this, SIGNAL( activated(int) ),
       this, SLOT( slotActivated(int) ) );
-  connect( kmkernel->folderMgr(), SIGNAL(changed()),
+  connect( kmkernel->folderMgr(), SIGNAL(changed()),
       this, SLOT(refreshFolders()) );
-  connect( kmkernel->dimapFolderMgr(), SIGNAL(changed()),
+  connect( kmkernel->dimapFolderMgr(), SIGNAL(changed()),
       this, SLOT(refreshFolders()) );
-  if (mImapShown)
-    connect( kmkernel->imapFolderMgr(), SIGNAL(changed()),
+  if (mImapShown)
+    connect( kmkernel->imapFolderMgr(), SIGNAL(changed()),
         this, SLOT(refreshFolders()) );
 }

@@ -60,10 +60,10 @@
   mImapShown = shown;
   refreshFolders();
   if (shown)
-    connect( kmkernel->imapFolderMgr(), SIGNAL(changed()),
+    connect( kmkernel->imapFolderMgr(), SIGNAL(changed()),
         this, SLOT(refreshFolders()) );
   else
-    disconnect( kmkernel->imapFolderMgr(), SIGNAL(changed()),
+    disconnect( kmkernel->imapFolderMgr(), SIGNAL(changed()),
         this, SLOT(refreshFolders()) );
 }

@@ -72,31 +72,25 @@
 void KMFolderComboBox::createFolderList(QStringList *names,
                                         QValueList<QGuardedPtr<KMFolder> > *folders)
 {
+  kmkernel->folderMgr()->createI18nFolderList( names, folders );
+  if ( !mOutboxShown ) {
+    QValueList< QGuardedPtr<KMFolder> >::iterator folderIt = folders->begin();
+    QStringList::iterator namesIt = names->begin();
+    for ( ; folderIt != folders->end(); ++folderIt, ++namesIt ) {
+      KMFolder *folder = *folderIt;
+      if ( folder == kmkernel->outboxFolder() )
+        break;
+    }
+    if ( folderIt != folders->end() ) {
+      folders->remove( folderIt );
+      names->remove( namesIt );
+    }
+  }
+
   if (mImapShown)
     kmkernel->imapFolderMgr()->createI18nFolderList( names, folders );

   kmkernel->dimapFolderMgr()->createI18nFolderList( names, folders );
-  kmkernel->folderMgr()->createFolderList( names, folders );
-  uint i = 0;
-  while (i < folders->count())
-  {
-    if ((*(folders->at(i)))->isSystemFolder()
-	&& (*(folders->at(i)))->folderType() != KMFolderTypeImap
-	&& (*(folders->at(i)))->folderType() != KMFolderTypeCachedImap)
-    {
-      folders->remove(folders->at(i));
-      names->remove(names->at(i));
-    }
-    else i++;
-  }
-
-  folders->prepend(kmkernel->draftsFolder());
-  folders->prepend(kmkernel->trashFolder());
-  folders->prepend(kmkernel->sentFolder());
-  if (mOutboxShown) folders->prepend(kmkernel->outboxFolder());
-  folders->prepend(kmkernel->inboxFolder());
-  for (int i = ((mOutboxShown) ? 4 : 3); i >= 0; i--)
-    names->prepend((*(folders->at(i)))->label());
 }

 //-----------------------------------------------------------------------------


#ifdef NDEBUG - you know...

#ifdef NDEBUG - you know...

svn path=/trunk/kdenetwork/kmail/; revision=199115

--- kmail/objecttreeparser.cpp
+++ kmail/objecttreeparser.cpp
@@ -1523,6 +1523,7 @@
 	  }
 	}

+#ifndef NDEBUG
 	QCString deb;
 	deb =  "\n\nS I G N A T U R E = ";
 	if( signatureIsBinary )
@@ -1536,6 +1537,7 @@
 	deb += cleartext;
 	deb += "\"  <--  E N D    O F    C O N T E N T\n\n";
 	kdDebug(5006) << deb << endl;
+#endif
       }

       struct CryptPlugWrapper::SignatureMetaData localSigMeta;


Do not display broken images when they are loaded by demand and have content disposition inline

svn path=/trunk/kdepim/; revision=374481

--- kmail/objecttreeparser.cpp
+++ kmail/objecttreeparser.cpp
@@ -301,6 +301,9 @@
     // neither image nor text -> show as icon
     if ( !result.isImage()
          && node->type() != DwMime::kTypeText )
+      asIcon = true;
+    // if the image is not complete do not try to show it inline
+    if ( result.isImage() && !node->msgPart().isComplete() )
       asIcon = true;
     if ( asIcon ) {
       if ( attachmentStrategy() != AttachmentStrategy::hidden()


Notify alarms immediately when client starts up

svn path=/trunk/kdepim/; revision=183967

--- kalarmd/alarmdaemon.cpp
+++ kalarmd/alarmdaemon.cpp
@@ -196,7 +196,7 @@
       kdDebug(5900) << "AlarmDaemon::reloadCal_(): calendar reloaded" << endl;
     notifyGuiCalStatus(cal);
     setTimerStatus();
-//    checkAlarms(cal);
+    checkAlarms(cal);
   }
 }


[fix] NamedPipeNetworkClient is restored.

--- InterProcessCommunication/NamedPipeNetworkClient/main.cpp
+++ InterProcessCommunication/NamedPipeNetworkClient/main.cpp
@@ -3,41 +3,46 @@
 #include <conio.h>
 #include <tchar.h>
 #include <strsafe.h>
+#include "logger.h"

 #define BUFSIZE 512

-int _tmain(int argc, TCHAR *argv[])
-{
-	_tprintf(TEXT("Client is started!\n\n"));
+int _tmain(int argc, _TCHAR* argv[]) {
+	//Init log
+	initlog(argv[0]);
+	_tprintf(_T("Client is started!\n\n"));

 	HANDLE hPipe = INVALID_HANDLE_VALUE; // Идентификатор канала
 	LPTSTR lpszPipename = TEXT("\\\\192.168.124.235\\pipe\\$$MyPipe$$"); // Имя создаваемого канала Pipe
-	TCHAR chBuf[BUFSIZE]; // Буфер для передачи данных через канал
+	_TCHAR chBuf[BUFSIZE]; // Буфер для передачи данных через канал
 	DWORD readbytes, writebytes; // Число байт прочитанных и переданных

 	// Создание SECURITY_ATTRIBUTES и SECURITY_DESCRIPTOR объектов
 	SECURITY_ATTRIBUTES sa;
 	SECURITY_DESCRIPTOR sd;
 	// Инициализация SECURITY_DESCRIPTOR значениями по-умолчанию
-	if (InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION) == 0)
-	{
-		_tprintf(TEXT("InitializeSecurityDescriptor failed with error %d\n"), GetLastError());
-		_getch();
-		return -1;
+	if (InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION) == 0) {
+		double errorcode = GetLastError();
+		writelog(_T("InitializeSecurityDescriptor failed, GLE = %d"), errorcode);
+		_tprintf(_T("InitializeSecurityDescriptor failed, GLE = %d\n"), errorcode);
+		closelog();
+		exit(2);
 	}
 	// Установка поля DACL в SECURITY_DESCRIPTOR в NULL
-	if (SetSecurityDescriptorDacl(&sd, TRUE, NULL, FALSE) == 0)
-	{
-		_tprintf(TEXT("SetSecurityDescriptorDacl failed with error %d\n"), GetLastError());
-		_getch();
-		return -1;
+	if (SetSecurityDescriptorDacl(&sd, TRUE, NULL, FALSE) == 0)	{
+		double errorcode = GetLastError();
+		writelog(_T("SetSecurityDescriptorDacl failed, GLE = %d"), errorcode);
+		_tprintf(_T("SetSecurityDescriptorDacl failed, GLE = %d\n"), errorcode);
+		closelog();
+		exit(3);
 	}
 	// Установка SECURITY_DESCRIPTOR в структуре SECURITY_ATTRIBUTES
 	sa.nLength = sizeof(SECURITY_ATTRIBUTES);
 	sa.lpSecurityDescriptor = &sd;
 	sa.bInheritHandle = FALSE; //запрещение наследования

-	_tprintf(TEXT("Try to use WaitNamedPipe...\n"));
+	writelog(_T("Try to use WaitNamedPipe..."));
+	_tprintf(_T("Try to use WaitNamedPipe...\n"));
 	// Пытаемся открыть именованный канал, если надо - ожидаем его освобождения
 	while (1)
 	{
@@ -57,24 +62,27 @@
 			break;

 		// Выход, если ошибка связана не с занятым каналом.
-		if (GetLastError() != ERROR_PIPE_BUSY)
-		{
-			_tprintf(TEXT("Could not open pipe. GLE=%d\n"), GetLastError());
-			_getch();
-			return -1;
+		if (GetLastError() != ERROR_PIPE_BUSY) {
+			double errorcode = GetLastError();
+			writelog(_T("Could not open pipe, GLE = %d"), errorcode);
+			_tprintf(_T("Could not open pipe, GLE = %d\n"), errorcode);
+			closelog();
+			exit(4);
 		}

 		// Если все каналы заняты, ждём 20 секунд
-		if (!WaitNamedPipe(lpszPipename, 20000))
-		{
-			_tprintf(TEXT("Could not open pipe: 20 second wait timed out."));
-			_getch();
-			return -1;
+		if (!WaitNamedPipe(lpszPipename, 20000)) {
+			double errorcode = GetLastError();
+			writelog(_T("Could not open pipe: 20 second wait timed out, GLE = %d"), errorcode);
+			_tprintf(_T("ould not open pipe: 20 second wait timed out, GLE = %d\n"), errorcode);
+			closelog();
+			exit(5);
 		}
 	}

 	// Выводим сообщение о создании канала
-	_tprintf(TEXT("Successfully connected!\n\nInput message...\n"));
+	writelog(_T("Successfully connected"));
+	_tprintf(_T("Successfully connected!\n\nInput message...\n"));
 	// Цикл обмена данными с серверным процессом
 	while (1)
 	{
@@ -82,19 +90,24 @@
 		_tprintf(TEXT("cmd>"));
 		// Вводим текстовую строку
 		_fgetts(chBuf, BUFSIZE, stdin);
+		writelog(_T("Inpust string is %s"), chBuf);
 		// Передаем введенную строку серверному процессу в качестве команды
-		if (!WriteFile(hPipe, chBuf, (lstrlen(chBuf) + 1)*sizeof(TCHAR), &writebytes, NULL))
-		{
-			_tprintf(TEXT("connection refused\n"));
+		if (!WriteFile(hPipe, chBuf, (lstrlen(chBuf) + 1)*sizeof(TCHAR), &writebytes, NULL)) {
+			double errorcode = GetLastError();
+			writelog(_T("Connection refused, GLE = %d"), errorcode);
+			_tprintf(_T("Connection refused, GLE = %d\n"), errorcode);
 			break;
 		}
 		// Получаем эту же команду обратно от сервера
-		if (ReadFile(hPipe, chBuf, BUFSIZE*sizeof(TCHAR), &readbytes, NULL))
-			_tprintf(TEXT("Received from server: %s\n"), chBuf);
+		if (ReadFile(hPipe, chBuf, BUFSIZE*sizeof(TCHAR), &readbytes, NULL)) {
+			writelog(_T("Received from server: %s\n"), chBuf);
+			_tprintf(_T("Received from server: %s\n"), chBuf);
+		}
 		// Если произошла ошибка, выводим ее код и завершаем работу приложения
 		else {
-			_tprintf(TEXT("ReadFile: Error %ld\n"), GetLastError());
-			_getch();
+			double errorcode = GetLastError();
+			writelog(_T("ReadFile: Error %ld"), errorcode);
+			_tprintf(_T("ReadFile: Error %ld\n"), errorcode);
 			break;
 		}
 		// В ответ на команду "exit" завершаем цикл обмена данными с серверным процессом
@@ -105,6 +118,7 @@
 	// Закрываем идентификатор канала
 	CloseHandle(hPipe);

+	closelog();
 	_tprintf(TEXT("Press ENTER to terminate connection and exit\n"));
 	_getch();
 	return 0;


CVS_SILENT

Corrected typo (foldertree -> folder tree).

svn path=/trunk/kdepim/; revision=328641

--- kmail/accountdialog.cpp
+++ kmail/accountdialog.cpp
@@ -867,7 +867,7 @@
     mImap.listOnlyOpenCheck = new QCheckBox(
         i18n("List only open folders"), page1);
     QWhatsThis::add( mImap.listOnlyOpenCheck,
-        i18n("Only folders that are open (expanded) in the foldertree are checked for subfolders. Use this if there are many folders on the server.") );
+        i18n("Only folders that are open (expanded) in the folder tree are checked for subfolders. Use this if there are many folders on the server.") );
     grid->addMultiCellWidget( mImap.listOnlyOpenCheck, row, row, 0, 1 );
   }


Don't leave a signTestNode lying around if we've already written out a deferred decryption block. Fixes regression kolab/issue3577.

svn path=/branches/kdepim/enterprise/kdepim/; revision=1022235

--- kmail/objecttreeparser.cpp
+++ kmail/objecttreeparser.cpp
@@ -1708,6 +1708,7 @@
       if ( mReader && !mReader->decryptMessage() ) {
         writeDeferredDecryptionBlock();
         isEncrypted = true;
+        signTestNode = 0; // PENDING(marc) to be abs. sure, we'd need to have to look at the content
       } else if ( okDecryptMIME( *node,
                           decryptedData,
                           signatureFound,


Fix crash if empty calendar file

Fix crash if empty calendar file

svn path=/trunk/kdepim/; revision=126608

--- kalarmd/alarmdaemon.cpp
+++ kalarmd/alarmdaemon.cpp
@@ -356,19 +356,21 @@

     case ADCalendar::KALARM:
       alarms = cal->alarmsTo( QDateTime::currentDateTime() );
-      kdDebug(5901) << "Kalarm alarms=" << alarms.count() << endl;
-      for ( it = alarms.begin(); it != alarms.end(); ++it ) {
-        Event *event = dynamic_cast<Event *>( (*it)->parent() );
-        if ( event ) {
-          const QString& eventID = event->VUID();
-          kdDebug(5901) << "AlarmDaemon::checkAlarms(): KALARM event " << eventID  << endl;
-          QValueList<QDateTime> alarmtimes;
-          checkEventAlarms(*event, alarmtimes);
-          if (!cal->eventHandled(event, alarmtimes)) {
-            if (notifyEvent(cal, eventID))
-              cal->setEventHandled(event, alarmtimes);
-            else
-              cal->setEventPending(eventID);
+      if (alarms.count()) {
+        kdDebug(5901) << "Kalarm alarms=" << alarms.count() << endl;
+        for ( it = alarms.begin(); it != alarms.end(); ++it ) {
+          Event *event = dynamic_cast<Event *>( (*it)->parent() );
+          if ( event ) {
+            const QString& eventID = event->VUID();
+            kdDebug(5901) << "AlarmDaemon::checkAlarms(): KALARM event " << eventID  << endl;
+            QValueList<QDateTime> alarmtimes;
+            checkEventAlarms(*event, alarmtimes);
+            if (!cal->eventHandled(event, alarmtimes)) {
+              if (notifyEvent(cal, eventID))
+                cal->setEventHandled(event, alarmtimes);
+              else
+                cal->setEventPending(eventID);
+            }
           }
         }
       }
@@ -402,6 +404,7 @@
   if (calendar)
   {
     ClientInfo client = getClientInfo(calendar->appName());
+kdDebug(5900)<<"Notification type="<<client.notificationType<<": "<<calendar->appName()<<endl;
     if (!client.isValid())
       kdDebug(5900) << "AlarmDaemon::notifyEvent(): unknown client" << endl;
     else
@@ -421,13 +424,16 @@
       {
         // The client application is not running
         if (client.notificationType == ClientInfo::NO_START_NOTIFY)
+        {
+          kdDebug(5900) << "AlarmDaemon::notifyEvent(): don't start client\n";
           return true;
+        }

         // Start the client application
         QString execStr = locate("exe", calendar->appName());
         if (execStr.isEmpty())
         {
-          kdDebug(5900) << "AlarmDaemon::notifyEvent(): '" << calendar->appName() << "' not found" << endl;
+          kdDebug(5900) << "AlarmDaemon::notifyEvent(): '" << calendar->appName() << "' not found\n";
           return true;
         }
         if (client.notificationType == ClientInfo::COMMAND_LINE_NOTIFY)
@@ -438,7 +444,7 @@
           execStr += " --calendarURL ";
           execStr += calendar->urlString();
           system(QFile::encodeName(execStr));
-          kdDebug(5900) << "AlarmDaemon::notifyEvent(): used command line" << endl;
+          kdDebug(5900) << "AlarmDaemon::notifyEvent(): used command line\n";
           return true;
         }
         system(QFile::encodeName(execStr));


CVS_SILENT Remove outdated comment.

CVS_SILENT Remove outdated comment.

svn path=/trunk/kdepim/; revision=374419

--- kmail/folderstorage.cpp
+++ kmail/folderstorage.cpp
@@ -208,8 +208,6 @@

 //-----------------------------------------------------------------------------

-// Needed to use QSortedList in reduceSize()
-
 /** Compare message's date. This is useful for message sorting */
 int operator<( KMMsgBase & m1, KMMsgBase & m2 )
 {


INTEGRATION: CWS vclcleanup02 (1.8.380); FILE MERGED 2003/12/18 09:45:18 mt 1.8.380.1: #i23061# header cleanup, remove #ifdef ???_CXX and #define ???_CXX, also removed .impl files and fixed some windows compiler warnings

--- vcl/aqua/source/app/saltimer.cxx
+++ vcl/aqua/source/app/saltimer.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: saltimer.cxx,v $
  *
- *  $Revision: 1.8 $
+ *  $Revision: 1.9 $
  *
- *  last change: $Author: pluby $ $Date: 2000-12-16 02:43:16 $
+ *  last change: $Author: vg $ $Date: 2004-01-06 12:44:39 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -59,8 +59,6 @@
  *
  ************************************************************************/

-#define _SV_SALTIMER_CXX
-
 #ifndef _SV_SALTIMER_HXX
 #include <saltimer.hxx>
 #endif


Switch to use XML_SUCCESS rather than XML_NO_ERROR

--- dart/utils/XmlHelpers.cpp
+++ dart/utils/XmlHelpers.cpp
@@ -726,7 +726,7 @@
   const int result = element->QueryBoolAttribute(attributeName.c_str(),
                                                  &val);

-  if (result != tinyxml2::XML_NO_ERROR)
+  if (result != tinyxml2::XML_SUCCESS)
   {
     dtwarn << "[getAttribute] Error in parsing bool type attribute ["
            << attributeName << "] of an element [" << element->Name()
@@ -744,7 +744,7 @@
   int val = 0;
   const int result = element->QueryIntAttribute(attributeName.c_str(), &val);

-  if (result != tinyxml2::XML_NO_ERROR)
+  if (result != tinyxml2::XML_SUCCESS)
   {
     dtwarn << "[getAttribute] Error in parsing int type attribute ["
            << attributeName << "] of an element [" << element->Name()
@@ -763,7 +763,7 @@
   const int result = element->QueryUnsignedAttribute(attributeName.c_str(),
                                                      &val);

-  if (result != tinyxml2::XML_NO_ERROR)
+  if (result != tinyxml2::XML_SUCCESS)
   {
     dtwarn << "[getAttribute] Error in parsing unsiged int type attribute ["
            << attributeName << "] of an element [" << element->Name()
@@ -782,7 +782,7 @@
   const int result = element->QueryFloatAttribute(attributeName.c_str(),
                                                   &val);

-  if (result != tinyxml2::XML_NO_ERROR)
+  if (result != tinyxml2::XML_SUCCESS)
   {
     dtwarn << "[getAttribute] Error in parsing float type attribute ["
            << attributeName << "] of an element [" << element->Name()
@@ -801,7 +801,7 @@
   const int result = element->QueryDoubleAttribute(attributeName.c_str(),
                                                    &val);

-  if (result != tinyxml2::XML_NO_ERROR)
+  if (result != tinyxml2::XML_SUCCESS)
   {
     dtwarn << "[getAttribute] Error in parsing double type attribute ["
            << attributeName << "] of an element [" << element->Name()


Clarify this new string as I saw discussion in the NL and IT team about it.

svn path=/branches/KDE/3.5/kdepim/; revision=779632

--- kmail/objecttreeparser.cpp
+++ kmail/objecttreeparser.cpp
@@ -2086,7 +2086,7 @@
   url.setPath( "showAuditLog" );
   url.addQueryItem( "log", auditLog );

-  return "" + i18n("Show Audit Log") + "";
+  return "" + i18n("The Audit Log is a detailed error log from the gnupg backend", "Show Audit Log") + "";
 }

 static QString endVerboseSigstatHeader( const PartMetaData & pmd )


Update personal acknoledgments

Update personal acknoledgments

--- MATLAB/Source/voxel_backprojection_parallel_spherical.hpp
+++ MATLAB/Source/voxel_backprojection_parallel_spherical.hpp
@@ -3,7 +3,7 @@
  * Header CUDA function for backrpojection  for parallel beam
  *
  *
- * CODE by  Ander Biguri
+ * CODE by  Ander Biguri & Sepideh Hatamikia
 ---------------------------------------------------------------------------
 ---------------------------------------------------------------------------
 Copyright (c) 2015, University of Bath and CERN- European Organization for


INTEGRATION: CWS vcl89 (1.31.16); FILE MERGED 2008/06/04 11:33:37 hdu 1.31.16.1: #i28610# where did this special handling of ITC come from?

--- vcl/unx/source/gdi/xlfd_extd.cxx
+++ vcl/unx/source/gdi/xlfd_extd.cxx
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: xlfd_extd.cxx,v $
- * $Revision: 1.31 $
+ * $Revision: 1.32 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -243,9 +243,6 @@
         mePitch     = GetPitch();

         maName      = pFamilyAttr->GetAnnotation();
-        // special case for X11 fonts from a ghostscript installation
-        if( maName.CompareIgnoreCaseToAscii( "itc ", 4 ) == COMPARE_EQUAL )
-            maName = maName.Copy( 4 );

         // the helvetica narrow hack
         if (  ! pFamilyAttr->HasFeature(XLFD_FEATURE_NARROW)


I should delete the server object.

I should delete the server object.

--- testserver.cpp
+++ testserver.cpp
@@ -50,6 +50,7 @@
       runTimer();
     }
   }
+  delete m_driver;
 }

 void TestServer::shutdown() {


Indentation fixes as pointed out by Thomas.

CCMAIL: thomas.mcguire@gmx.net

svn path=/branches/kdepim/enterprise4/kdepim/; revision=843424

--- kmail/recipientspicker.cpp
+++ kmail/recipientspicker.cpp
@@ -810,36 +810,35 @@

 void RecipientsPicker::slotSearchLDAP()
 {
-    if ( !mLdapSearchDialog ) {
-        mLdapSearchDialog = new KPIM::LdapSearchDialog( this );
-        connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ),
-                 SLOT(ldapSearchResult() ) );
-    }
-    mLdapSearchDialog->setSearchText( mSearchLine->text() );
-    mLdapSearchDialog->show();
-
+  if ( !mLdapSearchDialog ) {
+    mLdapSearchDialog = new KPIM::LdapSearchDialog( this );
+    connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ),
+             SLOT(ldapSearchResult() ) );
+  }
+  mLdapSearchDialog->setSearchText( mSearchLine->text() );
+  mLdapSearchDialog->show();
 }

 void RecipientsPicker::ldapSearchResult()
 {
-    QStringList emails = QStringList::split(',', mLdapSearchDialog->selectedEMails() );
-    QStringList::iterator it( emails.begin() );
-    QStringList::iterator end( emails.end() );
-    for ( ; it != end; ++it ){
-        QString name;
-        QString email;
-        KPIMUtils::extractEmailAddressAndName( (*it), email, name );
-        KABC::Addressee ad;
-        ad.setNameFromString( name );
-        ad.insertEmail( email );
-#ifdef KDEPIM_NEW_DISTRLISTS
-        RecipientItem *item = new RecipientItem( mAddressBook );
-#else
-        RecipientItem *item = new RecipientItem;
-#endif
-        item->setAddressee( ad, ad.preferredEmail() );
-        emit pickedRecipient( Recipient( item->recipient(), Recipient::Undefined ) );
-    }
+  QStringList emails = QStringList::split(',', mLdapSearchDialog->selectedEMails() );
+  QStringList::iterator it( emails.begin() );
+  QStringList::iterator end( emails.end() );
+  for ( ; it != end; ++it ){
+    QString name;
+    QString email;
+    KPIMUtils::extractEmailAddressAndName( (*it), email, name );
+    KABC::Addressee ad;
+    ad.setNameFromString( name );
+    ad.insertEmail( email );
+#ifdef KDEPIM_NEW_DISTRLISTS
+    RecipientItem *item = new RecipientItem( mAddressBook );
+#else
+    RecipientItem *item = new RecipientItem;
+#endif
+    item->setAddressee( ad, ad.preferredEmail() );
+    emit pickedRecipient( Recipient( item->recipient(), Recipient::Undefined ) );
+  }
 }

 #include "recipientspicker.moc"


Fix markup (changes one i18n string) and warn KDE 3.2 users about bugs they suffer.

svn path=/trunk/kdepim/; revision=380874

--- kpilot/kpilot/logWidget.cc
+++ kpilot/kpilot/logWidget.cc
@@ -126,11 +126,17 @@
 #endif

 	initialText.append(CSL1(TE_EOL));
-	initialText.append(i18n("<qt>HotSync Log</qt>"));
+	initialText.append(i18n("<qt>HotSync Log</qt>"));
 	initialText.append(CSL1(TE_EOL));

-	initialText.append(CSL1(TE_EOL "<QT>KPilot has been reported to cause "
-		"data loss. Please check with kdepim-users@kde.org.</QT>" TE_EOL));
+	initialText.append(CSL1(TE_EOL "<qt>KPilot has been reported to cause "
+		"data loss. Please check with kdepim-users@kde.org.</qt>" TE_EOL));
+
+#if KDE_IS_VERSION(3,3,0)
+#else
+	initialText.append(CSL1(TE_EOL "<qt>KDE 3.2 is no longer supported. Please update to KDE 3.3 or later.</qt>" TE_EOL));
+	initialText.append(CSL1(TE_EOL "<qt>You may be unable to do conflict resolution.</qt>" TE_EOL));
+#endif

 	fLog->setText(initialText);
 	fLog->scrollToBottom();


ENH: add new line character at the end of the command

--- Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetModel.cxx
+++ Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetModel.cxx
@@ -84,6 +84,8 @@
   TiXmlElement * pName, *pParam;
   std::ostringstream cmdLine;

+  cmdLine << "";
+
   if(XMLAppElement)
     {
     pName = XMLAppElement->FirstChildElement("name");
@@ -139,6 +141,9 @@
       pParam = pParam->NextSiblingElement(); // iteration over parameters
       }

+    //Insert a new line character at the end of the command line
+    cmdLine << std::endl;
+
     //Report the command line string to the application logger
     m_Application->GetLogger()->Write(itk::LoggerBase::INFO, cmdLine.str());
     }


Change names of the files written to match the one in tests.

--- OpenSim/Examples/CustomActuatorExample/toyLeg_example.cpp
+++ OpenSim/Examples/CustomActuatorExample/toyLeg_example.cpp
@@ -226,10 +226,11 @@

         auto statesTable = manager.getStatesTable();
         osimModel.updSimbodyEngine().convertRadiansToDegrees(statesTable);
-        MOTFileAdapter::write(statesTable, "SpringActuatedLeg_states.mot");
+        MOTFileAdapter::write(statesTable,
+                              "SpringActuatedLeg_states_degrees.mot");

         auto forcesTable = forces->getForcesTable();
-        MOTFileAdapter::write(forcesTable, "SpringActuatedLeg_forces.mot");
+        MOTFileAdapter::write(forcesTable, "actuator_forces.mot");
     }
     catch (const std::exception& ex)
     {


improve error message

improve error message

--- moveit_planners/ompl/core/ompl_interface/src/model_based_planning_context.cpp
+++ moveit_planners/ompl/core/ompl_interface/src/model_based_planning_context.cpp
@@ -101,8 +101,8 @@
 	    logWarn("%s: Ignoring joint '%s' in projection since it has 0 DOF", name_.c_str(), v.c_str());
 	}
 	else
-	  logError("%s: Attempted to set projection evaluator with respect to value of joint '%s', but that joint is not known to the kinematic model.",
-                   name_.c_str(), v.c_str());
+	  logError("%s: Attempted to set projection evaluator with respect to value of joint '%s', but that joint is not known to the group '%s'.",
+                   name_.c_str(), v.c_str(), getJointModelGroup()->getName().c_str());
       }
       if (j.empty())
 	logError("%s: No valid joints specified for joint projection", name_.c_str());


Remove NPN Support

Remove NPN Support

Summary: ALPN is the preferred way to do this.  We should only use that and not provide NPN support anymore.

Reviewed By: knekritz

Differential Revision: D10110626

fbshipit-source-id: 5ec91fe51252bed0a8d8047e481df76a395e1286

--- wangle/ssl/SSLContextManager.cpp
+++ wangle/ssl/SSLContextManager.cpp
@@ -555,10 +555,9 @@

   // NPN (Next Protocol Negotiation)
   if (!ctxConfig.nextProtocols.empty()) {
-#ifdef OPENSSL_NPN_NEGOTIATED
+#if FOLLY_OPENSSL_HAS_ALPN
     sslCtx->setRandomizedAdvertisedNextProtocols(
-        ctxConfig.nextProtocols,
-        SSLContext::NextProtocolType::ALPN);
+        ctxConfig.nextProtocols);
 #else
     OPENSSL_MISSING_FEATURE(NPN);
 #endif


reverting last change

reverting last change

svn path=/trunk/kdenetwork/kopete/; revision=376849

--- kopete/kopetewindow.cpp
+++ kopete/kopetewindow.cpp
@@ -192,7 +192,7 @@
 	actionShowOffliners->setCheckedState(i18n("Hide Offline &Users"));
 	actionShowEmptyGroups->setCheckedState(i18n("Hide Empty &Groups"));
 #endif
-
+
 	// quick search bar
 	QHBox *quickSearchContainer = new QHBox( 0, "kde toolbar widget" );
 	QLabel *searchLabel = new QLabel( i18n("Se&arch:"), quickSearchContainer, "kde toolbar widget" );
@@ -207,7 +207,7 @@
 		0, searchBar, SLOT( clear() ), actionCollection(), "quicksearch_reset" );
 	resetQuickSearch->setWhatsThis( i18n( "Reset Quick Search\n"
 		"Resets the quick search so that all contacts and groups are shown again." ) );
-
+
 	// sync actions, config and prefs-dialog
 	connect ( KopetePrefs::prefs(), SIGNAL(saved()), this, SLOT(slotConfigChanged()) );
 	slotConfigChanged();
@@ -308,7 +308,7 @@

 	toolBar("mainToolBar")->saveSettings ( config, "ToolBar Settings" );
 	toolBar("quickSearchBar")->saveSettings( config, "QuickSearchBar Settings" );
-
+
 	saveMainWindowSettings( config, "General Options" );

 	config->setGroup("General Options");
@@ -350,7 +350,7 @@
 void KopeteWindow::slotToggleShowOffliners()
 {
 	KopetePrefs *p = KopetePrefs::prefs();
-	p->setShowOffline ( !actionShowOffliners->isChecked() );
+	p->setShowOffline ( actionShowOffliners->isChecked() );

 	disconnect ( KopetePrefs::prefs(), SIGNAL(saved()), this, SLOT(slotConfigChanged()) );
 	p->save();
@@ -609,7 +609,7 @@
 	if(m_tray)
 	{
 		QToolTip::remove(m_tray);
-
+
 		QString tt = QString::fromLatin1("<qt>");
 		QPtrList<Kopete::Account> accounts = Kopete::AccountManager::self()->accounts();
 		for(Kopete::Account *a = accounts.first(); a; a = accounts.next())


One little correction

One little correction

Change-Id: I675bd8a966b2c1654cd6547fc380a51925578835

--- l10ntools/source/merge.cxx
+++ l10ntools/source/merge.cxx
@@ -196,7 +196,7 @@
         }
         catch( PoHeader::Exception& aException )
         {
-            if( aException = PoHeader::NOLANG )
+            if( aException == PoHeader::NOLANG )
             {
                 printf(
                     "Warning : %s' header not has language specification\n",


fix crash (CID 1323)

fix crash (CID 1323)

svn path=/trunk/KDE/kdepim/; revision=534559

--- korganizer/koagenda.cpp
+++ korganizer/koagenda.cpp
@@ -986,7 +986,7 @@
           }
           changed=true;
         }
-        if ( !moveItem->lastMultiItem() && !mAllDayMode ) { // is the last item
+        if ( moveItem && !moveItem->lastMultiItem() && !mAllDayMode ) { // is the last item
           int newY = deltapos.y()+moveItem->cellYBottom();
           if (newY<0) {
             // erase current item


Use enum instead of char values for run_mode

svn path=/trunk/kdepim/; revision=229696

--- kpilot/kpilot/kpilot.cc
+++ kpilot/kpilot/kpilot.cc
@@ -896,7 +896,7 @@
 // kpilot still does a setup the first time it is run.
 //
 //
-int run_mode = 0;
+enum { Normal, ConfigureKPilot, ConfigureConduits, ConfigureAndContinue } run_mode = Normal;

 int main(int argc, char **argv)
@@ -939,11 +939,11 @@

 	if (p->isSet("setup"))
 	{
-		run_mode = 's';
+		run_mode = ConfigureKPilot;
 	}
 	if (p->isSet("conduit-setup"))
 	{
-		run_mode = 'c';
+		run_mode = ConfigureConduits;
 	}

 	if (!KUniqueApplication::start())
@@ -957,10 +957,17 @@
 	KPilotConfigSettings & c = KPilotConfig::getConfig();
 	if (c.getVersion() < KPilotConfig::ConfigurationVersion)
 	{
-		run_mode = 'S';
-	}
-
-	if (run_mode == 'c')
+		kdWarning() << ": KPilot configuration version "
+			<< KPilotConfig::ConfigurationVersion
+			<< " newer than stored version "
+			<< c.getVersion() << endl;
+		// Only force a reconfigure and continue if the
+		// user is expecting normal startup. Otherwise,
+		// do the configuration they're explicitly asking for.
+		if (Normal==run_mode) run_mode = ConfigureAndContinue;
+	}
+
+	if (run_mode == ConfigureConduits)
 	{
 		ConduitConfigDialog *cs = new ConduitConfigDialog(0L,0L,true);
 		int r = cs->exec();
@@ -975,7 +982,7 @@
 		}
 	}

-	if ((run_mode == 's') || (run_mode == 'S'))
+	if ((run_mode == ConfigureKPilot) || (run_mode == ConfigureAndContinue))
 	{
 #ifdef DEBUG
 		DEBUGKPILOT << fname
@@ -987,7 +994,7 @@
 			"configDialog", true);
 		int r = options->exec();

-		if (run_mode == 's')
+		if (run_mode == ConfigureKPilot)
 		{
 			if (!r)
 			{


add missing #include

add missing #include

--- warpcoil/cpp/client_pipeline.hpp
+++ warpcoil/cpp/client_pipeline.hpp
@@ -2,7 +2,7 @@

 #include <warpcoil/cpp/expected_response_registry.hpp>
 #include <warpcoil/cpp/buffered_writer.hpp>
-#include <warpcoil/cpp/integer_parser.hpp>
+#include <warpcoil/cpp/write_integer.hpp>

 namespace warpcoil
 {


delete debugging messages

delete debugging messages

--- moses/FF/SpanLength.cpp
+++ moses/FF/SpanLength.cpp
@@ -50,11 +50,9 @@
   assert(slProp);

   string str = slProp->GetValueString();
-  cerr << "str=" << str << endl;

   const Phrase *ruleSource = targetPhrase.GetRuleSource();
   assert(ruleSource);
-  cerr << *ruleSource << endl;

   float score = 0;
   for (size_t i = 0; i < stackVec->size(); ++i) {


Fix(Core/Gameobjects): non-consumable goobers no longer despawn on use (#2750)

Taken from https://github.com/TrinityCore/TrinityCore/commit/50c5d30d13fe12af2a2028baf845fb6eab329a57 & https://github.com/TrinityCore/TrinityCore/commit/2b1e8d135bd3f3a3ddf7f29471cf6116da223175

Co-authored-by: Wyrserth <13cab23f44ca95a6e7dcc4df3144a5139f1d72db@protonmail.com>

--- src/server/game/Entities/GameObject/GameObject.cpp
+++ src/server/game/Entities/GameObject/GameObject.cpp
@@ -702,13 +702,21 @@

             loot.clear();

-            //! If this is summoned by a spell with ie. SPELL_EFFECT_SUMMON_OBJECT_WILD, with or without owner, we check respawn criteria based on spell
-            //! The GetOwnerGUID() check is mostly for compatibility with hacky scripts - 99% of the time summoning should be done trough spells.
-            if (GetSpellId() || GetOwnerGUID())
+            // Do not delete gameobjects that are not consumed on loot, while still allowing them to despawn when they expire if summoned
+            bool isSummonedAndExpired = (GetOwner() || GetSpellId()) && m_respawnTime == 0;
+            bool isPermanentSpawn = m_respawnDelayTime == 0;
+            if (!GetGOInfo()->IsDespawnAtAction() &&
+                ((GetGoType() == GAMEOBJECT_TYPE_GOOBER && (!isSummonedAndExpired || isPermanentSpawn)) ||
+                (GetGoType() == GAMEOBJECT_TYPE_CHEST && !isSummonedAndExpired  && GetGOInfo()->chest.chestRestockTime == 0))) // ToDo: chests with data2 (chestRestockTime) > 0 and data3 (consumable) = 0 should not despawn on loot
+            {
+                SetLootState(GO_READY);
+                UpdateObjectVisibility();
+                return;
+            }
+            else
             {
                 SetRespawnTime(0);
                 Delete();
-                return;
             }

             SetLootState(GO_READY);