← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2912: fix issues with the DL queue tree

 

------------------------------------------------------------
revno: 2912
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2012-05-04 23:20:44 +0200
message:
  fix issues with the DL queue tree
modified:
  changelog.txt
  dcpp/version.h
  win32/DCPlusPlus.rc
  win32/QueueFrame.cpp
  win32/RichTextBox.cpp
  win32/TypedTree.h


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'changelog.txt'
--- changelog.txt	2012-04-30 16:31:37 +0000
+++ changelog.txt	2012-05-04 21:20:44 +0000
@@ -1,6 +1,8 @@
 * Add icons (iceman50)
 * Fix table header column translations (emtee)
 * Improve chat link menus (poy)
+* Fix crashes when closing the DL queue window (poy)
+* [L#330176] More reasonable DL queue directory expansion (poy)
 
 -- 0.797 2012-04-17 --
 * Save and restore partial file lists (poy)

=== modified file 'dcpp/version.h'
--- dcpp/version.h	2012-04-12 15:46:28 +0000
+++ dcpp/version.h	2012-05-04 21:20:44 +0000
@@ -21,8 +21,8 @@
 #define APPNAME "DC++"
 
 // don't forget to update the .rc file as well!
-#define VERSIONSTRING "0.797"
-#define VERSIONFLOAT 0.797
+#define VERSIONSTRING "0.799"
+#define VERSIONFLOAT 0.799
 
 namespace dcpp {
 extern const std::string fullVersionString;

=== modified file 'win32/DCPlusPlus.rc'
--- win32/DCPlusPlus.rc	2012-04-28 18:02:09 +0000
+++ win32/DCPlusPlus.rc	2012-05-04 21:20:44 +0000
@@ -99,8 +99,8 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,7,9,7
- PRODUCTVERSION 0,7,9,7
+ FILEVERSION 0,7,9,9
+ PRODUCTVERSION 0,7,9,9
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -117,12 +117,12 @@
         BEGIN
             VALUE "Comments", "http://dcplusplus.sourceforge.net";
             VALUE "FileDescription", "DC++"
-            VALUE "FileVersion", "0, 7, 9, 7"
+            VALUE "FileVersion", "0, 7, 9, 9"
             VALUE "InternalName", "DC++"
             VALUE "LegalCopyright", "Copyright 2001-2012 Jacek Sieka"
             VALUE "OriginalFilename", "DCPlusPlus.exe"
             VALUE "ProductName", "DC++"
-            VALUE "ProductVersion", "0, 7, 9, 7"
+            VALUE "ProductVersion", "0, 7, 9, 9"
         END
     END
     BLOCK "VarFileInfo"

=== modified file 'win32/QueueFrame.cpp'
--- win32/QueueFrame.cpp	2012-04-15 22:19:38 +0000
+++ win32/QueueFrame.cpp	2012-05-04 21:20:44 +0000
@@ -167,6 +167,13 @@
 		addQueueItem(ii, true);
 	}
 
+	// expand top-level directories.
+	auto node = dirs->getRoot();
+	while(node) {
+		dirs->expand(node);
+		node = dirs->getNextSibling(node);
+	}
+
 	files->resort();
 }
 
@@ -222,12 +229,9 @@
 }
 
 void QueueFrame::postClosing() {
-	dirs->clear();
-	files->clear();
 	for(auto& i: directories) {
 		delete i.second;
 	}
-	directories.clear();
 
 	SettingsManager::getInstance()->set(SettingsManager::QUEUE_PANED_POS, paned->getSplitterPos(0));
 	SettingsManager::getInstance()->set(SettingsManager::QUEUEFRAME_ORDER, WinUtil::toString(files->getColumnOrder()));
@@ -432,7 +436,7 @@
 		// We assume we haven't added it yet, and that all filelists go to the same
 		// directory...
 		dcassert(fileLists == NULL);
-		fileLists = dirs->insert(NULL, new DirItemInfo(dir, T_("File Lists")), true);
+		fileLists = dirs->insert(NULL, new DirItemInfo(dir, T_("File Lists")));
 		return fileLists;
 	}
 
@@ -462,10 +466,10 @@
 			// First addition, set commonStart to the dir minus the last part...
 			i = dir.rfind('\\', dir.length()-2);
 			if(i != string::npos) {
-				next = dirs->insert(NULL, new DirItemInfo(dir.substr(0, i+1)), true);
+				next = dirs->insert(NULL, new DirItemInfo(dir.substr(0, i+1)));
 			} else {
 				dcassert(dir.length() == 3);
-				next = dirs->insert(NULL, new DirItemInfo(dir, Text::toT(dir)), true);
+				next = dirs->insert(NULL, new DirItemInfo(dir, Text::toT(dir)));
 			}
 		}
 
@@ -488,7 +492,7 @@
 			HTREEITEM oldRoot = next;
 
 			// Create a new root
-			HTREEITEM newRoot = dirs->insert(NULL, new DirItemInfo(rootStr.substr(0, i)), true);
+			HTREEITEM newRoot = dirs->insert(NULL, new DirItemInfo(rootStr.substr(0, i)));
 
 			parent = addDirectory(rootStr, false, newRoot);
 
@@ -531,7 +535,7 @@
 			// We didn't find it, add...
 			j = dir.find('\\', i);
 			dcassert(j != string::npos);
-			parent = dirs->insert(parent, new DirItemInfo(dir.substr(0, j+1), Text::toT(dir.substr(i, j-i))), true);
+			parent = dirs->insert(parent, new DirItemInfo(dir.substr(0, j+1), Text::toT(dir.substr(i, j-i))));
 			i = j + 1;
 		}
 	}

=== modified file 'win32/RichTextBox.cpp'
--- win32/RichTextBox.cpp	2012-04-30 16:31:37 +0000
+++ win32/RichTextBox.cpp	2012-05-04 21:20:44 +0000
@@ -96,7 +96,7 @@
 	if(!currentLink.empty()) {
 		menu->appendSeparator();
 		auto text = currentLink;
-		auto linkMenu = menu->appendPopup(T_("Link"), WinUtil::menuIcon(IDI_LINKS));
+		auto linkMenu = menu->appendPopup(dwt::util::escapeMenu(text), WinUtil::menuIcon(IDI_LINKS));
 		linkMenu->appendItem(T_("&Open"), [this, text] { openLink(text); }, WinUtil::menuIcon(IDI_RIGHT), true, true);
 		linkMenu->appendItem(T_("&Copy"), [this, text] { WinUtil::setClipboard(text); });
 	}

=== modified file 'win32/TypedTree.h'
--- win32/TypedTree.h	2012-01-13 20:55:20 +0000
+++ win32/TypedTree.h	2012-05-04 21:20:44 +0000
@@ -62,13 +62,8 @@
 		}
 	}
 
-	HTREEITEM insert(HTREEITEM parent, ContentType* data, bool expanded = false) {
+	HTREEITEM insert(HTREEITEM parent, ContentType* data) {
 		TVINSERTSTRUCT item = { parent, TVI_SORT, { { TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM | TVIF_TEXT } } };
-		if(expanded) {
-			item.itemex.mask |= TVIF_STATE;
-			item.itemex.state = TVIS_EXPANDED;
-			item.itemex.stateMask = TVIS_EXPANDED;
-		}
 		item.itemex.pszText = LPSTR_TEXTCALLBACK;
 		item.itemex.iImage = I_IMAGECALLBACK;
 		item.itemex.iSelectedImage = I_IMAGECALLBACK;