From: <arn...@us...> - 2006-04-01 18:17:34
|
Revision: 596 Author: arnetheduck Date: 2006-04-01 10:17:13 -0800 (Sat, 01 Apr 2006) ViewCVS: http://svn.sourceforge.net/dcplusplus/?rev=596&view=rev Log Message: ----------- A few fixes for the new release Modified Paths: -------------- dcplusplus/trunk/DCPlusPlus.rc dcplusplus/trunk/Example.xml dcplusplus/trunk/changelog.txt dcplusplus/trunk/client/BufferedSocket.cpp dcplusplus/trunk/client/QueueManager.cpp dcplusplus/trunk/client/version.h dcplusplus/trunk/help/changelog.html dcplusplus/trunk/windows/DirectoryListingFrm.cpp dcplusplus/trunk/windows/DirectoryListingFrm.h dcplusplus/trunk/windows/HubFrame.cpp dcplusplus/trunk/windows/HubFrame.h dcplusplus/trunk/windows/MainFrm.cpp Modified: dcplusplus/trunk/DCPlusPlus.rc =================================================================== --- dcplusplus/trunk/DCPlusPlus.rc 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/DCPlusPlus.rc 2006-04-01 18:17:13 UTC (rev 596) @@ -933,8 +933,8 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,6,8,8 - PRODUCTVERSION 0,6,8,8 + FILEVERSION 0,6,8,9 + PRODUCTVERSION 0,6,8,9 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -951,12 +951,12 @@ BEGIN VALUE "Comments", "http://dcplusplus.sourceforge.net" VALUE "FileDescription", "DC++" - VALUE "FileVersion", "0, 6, 8, 8" + VALUE "FileVersion", "0, 6, 8, 9" VALUE "InternalName", "DC++" VALUE "LegalCopyright", "Copyright 2001-2006 Jacek Sieka" VALUE "OriginalFilename", "DCPlusPlus.exe" VALUE "ProductName", "DC++" - VALUE "ProductVersion", "0, 6, 8, 8" + VALUE "ProductVersion", "0, 6, 8, 9" END END BLOCK "VarFileInfo" Modified: dcplusplus/trunk/Example.xml =================================================================== --- dcplusplus/trunk/Example.xml 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/Example.xml 2006-04-01 18:17:13 UTC (rev 596) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<Language Name="Example Language" Author="arnetheduck" Version="0.688" Revision="1" RightToLeft="0"> +<Language Name="Example Language" Author="arnetheduck" Version="0.689" Revision="1" RightToLeft="0"> <Strings> <String Name="Active">Active</String> <String Name="ActiveSearchString">Enabled / Search String</String> Modified: dcplusplus/trunk/changelog.txt =================================================================== --- dcplusplus/trunk/changelog.txt 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/changelog.txt 2006-04-01 18:17:13 UTC (rev 596) @@ -1,4 +1,10 @@ --- 0.688 2006-03-18 -- +-- 0.689 2006-04-01 -- +* Fixed displaying of available bytes when user list is off +* Fixed a potential crash when not showing user list +* Fixed 100% CPU bug on upload +* [bug 853] Fixed missing function in opencow + +-- 0.688 2006-03-18 -- * Fixed public hubs sorting (thanks pothead) * Fixed a ZPipe issue (thanks jove) * [bug 858] Fixed a 100% cpu / crash bug Modified: dcplusplus/trunk/client/BufferedSocket.cpp =================================================================== --- dcplusplus/trunk/client/BufferedSocket.cpp 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/client/BufferedSocket.cpp 2006-04-01 18:17:13 UTC (rev 596) @@ -309,7 +309,7 @@ fire(BufferedSocketListener::BytesSent(), 0, written); } else if(written == -1) { - if(readPos < readBuf.size()) { + if(!readDone && readPos < readBuf.size()) { // Read a little since we're blocking anyway... size_t bytesRead = min(readBuf.size() - readPos, readBuf.size() / 2); size_t actual = file->read(&readBuf[readPos], bytesRead); @@ -324,9 +324,14 @@ readPos += actual; } } else { - int w = sock->wait(POLL_TIMEOUT, Socket::WAIT_WRITE | Socket::WAIT_READ); - if(w & Socket::WAIT_READ) { - threadRead(); + while(!disconnecting) { + int w = sock->wait(POLL_TIMEOUT, Socket::WAIT_WRITE | Socket::WAIT_READ); + if(w & Socket::WAIT_READ) { + threadRead(); + } + if(w & Socket::WAIT_WRITE) { + break; + } } } } Modified: dcplusplus/trunk/client/QueueManager.cpp =================================================================== --- dcplusplus/trunk/client/QueueManager.cpp 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/client/QueueManager.cpp 2006-04-01 18:17:13 UTC (rev 596) @@ -399,7 +399,7 @@ if(BOOLSETTING(AUTO_SEARCH) && (aTick >= nextSearch) && (fileQueue.getSize() > 0)) { // We keep 30 recent searches to avoid duplicate searches - while((recent.size() > fileQueue.getSize()) || (recent.size() > 30)) { + while((recent.size() >= fileQueue.getSize()) || (recent.size() > 30)) { recent.erase(recent.begin()); } Modified: dcplusplus/trunk/client/version.h =================================================================== --- dcplusplus/trunk/client/version.h 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/client/version.h 2006-04-01 18:17:13 UTC (rev 596) @@ -17,8 +17,8 @@ */ #define APPNAME "DC++" -#define VERSIONSTRING "0.688" -#define VERSIONFLOAT 0.688 +#define VERSIONSTRING "0.689" +#define VERSIONFLOAT 0.689 /* Update the .rc file as well... */ Modified: dcplusplus/trunk/help/changelog.html =================================================================== --- dcplusplus/trunk/help/changelog.html 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/help/changelog.html 2006-04-01 18:17:13 UTC (rev 596) @@ -13,6 +13,14 @@ <h1>DC++ Changelog</h1> See the version history of DC++ below. +<h2>0.689 <span style="color: gray;">(2006-04-01)</span></h2> +<ul> + <li>Fixed displaying of available bytes when user list is off</li> + <li>Fixed a potential crash when not showing user list</li> + <li>Fixed 100% CPU bug on upload</li> + <li>[bug 853] Fixed missing function in opencow</li> +</ul> + <h2>0.688 <span style="color: gray;">(2006-03-18)</span></h2> <ul> <li>Fixed public hubs sorting (thanks pothead)</li> Modified: dcplusplus/trunk/windows/DirectoryListingFrm.cpp =================================================================== --- dcplusplus/trunk/windows/DirectoryListingFrm.cpp 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/windows/DirectoryListingFrm.cpp 2006-04-01 18:17:13 UTC (rev 596) @@ -339,6 +339,16 @@ } } +void DirectoryListingFrame::up() { + HTREEITEM t = ctrlTree.GetSelectedItem(); + if(t == NULL) + return; + t = ctrlTree.GetParentItem(t); + if(t == NULL) + return; + ctrlTree.SelectItem(t); +} + void DirectoryListingFrame::back() { if(history.size() > 1 && historyIndex > 1) { size_t n = min(historyIndex, history.size()) - 1; @@ -829,15 +839,13 @@ LRESULT DirectoryListingFrame::onKeyDown(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/) { NMLVKEYDOWN* kd = (NMLVKEYDOWN*) pnmh; if(kd->wVKey == VK_BACK) { - HTREEITEM cur = ctrlTree.GetSelectedItem(); - if(cur != NULL) - { - HTREEITEM parent = ctrlTree.GetParentItem(cur); - if(parent != NULL) - ctrlTree.SelectItem(parent); - } + up(); } else if(kd->wVKey == VK_TAB) { onTab(); + } else if(kd->wVKey == VK_LEFT && WinUtil::isAlt()) { + back(); + } else if(kd->wVKey == VK_RIGHT && WinUtil::isAlt()) { + forward(); } else if(kd->wVKey == VK_RETURN) { if(ctrlList.GetSelectedCount() == 1) { ItemInfo* ii = (ItemInfo*)ctrlList.GetItemData(ctrlList.GetNextItem(-1, LVNI_SELECTED)); Modified: dcplusplus/trunk/windows/DirectoryListingFrm.h =================================================================== --- dcplusplus/trunk/windows/DirectoryListingFrm.h 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/windows/DirectoryListingFrm.h 2006-04-01 18:17:13 UTC (rev 596) @@ -230,6 +230,7 @@ void updateStatus(); void initStatus(); void addHistory(const string& name); + void up(); void back(); void forward(); Modified: dcplusplus/trunk/windows/HubFrame.cpp =================================================================== --- dcplusplus/trunk/windows/HubFrame.cpp 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/windows/HubFrame.cpp 2006-04-01 18:17:13 UTC (rev 596) @@ -612,11 +612,11 @@ } void HubFrame::clearUserList() { + ctrlUsers.DeleteAllItems(); for(UserMapIter i = userMap.begin(); i != userMap.end(); ++i) { delete i->second; } userMap.clear(); - ctrlUsers.DeleteAllItems(); } void HubFrame::clearTaskList() { @@ -907,6 +907,14 @@ } } +LRESULT HubFrame::onFileReconnect(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { + client->disconnect(false); + clearUserList(); + clearTaskList(); + client->connect(); + return 0; +} + LRESULT HubFrame::onChar(UINT uMsg, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled) { if(!complete.empty() && wParam != VK_TAB && uMsg == WM_KEYDOWN) complete.clear(); @@ -1037,6 +1045,7 @@ ctrlUsers.resort(); } else { showUsers = false; + ctrlUsers.DeleteAllItems(); } SettingsManager::getInstance()->set(SettingsManager::GET_USER_INFO, showUsers); Modified: dcplusplus/trunk/windows/HubFrame.h =================================================================== --- dcplusplus/trunk/windows/HubFrame.h 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/windows/HubFrame.h 2006-04-01 18:17:13 UTC (rev 596) @@ -56,6 +56,7 @@ NOTIFY_HANDLER(IDC_USERS, NM_DBLCLK, onDoubleClickUsers) NOTIFY_HANDLER(IDC_USERS, LVN_KEYDOWN, onKeyDownUsers) NOTIFY_HANDLER(IDC_USERS, NM_RETURN, onEnterUsers) + NOTIFY_HANDLER(IDC_USERS, LVN_ITEMCHANGED, onItemChanged) NOTIFY_CODE_HANDLER(TTN_GETDISPINFO, onGetToolTip) MESSAGE_HANDLER(WM_CLOSE, onClose) MESSAGE_HANDLER(WM_SETFOCUS, onSetFocus) @@ -65,7 +66,7 @@ MESSAGE_HANDLER(WM_CTLCOLORSTATIC, onCtlColor) MESSAGE_HANDLER(WM_CTLCOLOREDIT, onCtlColor) MESSAGE_HANDLER(FTM_CONTEXTMENU, onTabContextMenu) - COMMAND_ID_HANDLER(ID_FILE_RECONNECT, OnFileReconnect) + COMMAND_ID_HANDLER(ID_FILE_RECONNECT, onFileReconnect) COMMAND_ID_HANDLER(IDC_FOLLOW, onFollow) COMMAND_ID_HANDLER(IDC_SEND_MESSAGE, onSendMessage) COMMAND_ID_HANDLER(IDC_ADD_AS_FAVORITE, onAddAsFavorite) @@ -98,6 +99,7 @@ LRESULT onEnterUsers(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/); LRESULT onGetToolTip(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/); LRESULT onCtlColor(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); + LRESULT onFileReconnect(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); void UpdateLayout(BOOL bResizeBars = TRUE); void addLine(const tstring& aLine); @@ -129,11 +131,8 @@ return 0; } - LRESULT OnFileReconnect(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { - client->disconnect(false); - clearUserList(); - clearTaskList(); - client->connect(); + LRESULT onItemChanged(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) { + updateStatusBar(); return 0; } @@ -150,7 +149,6 @@ public: TypedListViewCtrl<UserInfo, IDC_USERS>& getUserList() { return ctrlUsers; } private: - enum Speakers { UPDATE_USER_JOIN, UPDATE_USER, REMOVE_USER, ADD_CHAT_LINE, ADD_STATUS_LINE, ADD_SILENT_STATUS_LINE, SET_WINDOW_TITLE, GET_PASSWORD, PRIVATE_MESSAGE, STATS, CONNECTED, DISCONNECTED @@ -254,6 +252,11 @@ typedef FrameMap::iterator FrameIter; static FrameMap frames; + typedef vector<Task*> TaskList; + typedef TaskList::iterator TaskIter; + typedef HASH_MAP<User::Ptr, UserInfo*, User::HashFunction> UserMap; + typedef UserMap::iterator UserMapIter; + tstring redirect; bool timeStamps; bool showJoins; @@ -273,18 +276,21 @@ void operator()(UserInfo *ui) { available += ui->getIdentity().getBytesShared(); } + void operator()(UserMap::const_reference ui) { + available += ui.second->getIdentity().getBytesShared(); + } }; size_t getUserCount() const { size_t sel = ctrlUsers.GetSelectedCount(); - return sel > 1 ? sel : client->getUserCount(); + return sel > 1 ? sel : userMap.size(); } int64_t getAvailable() { if (ctrlUsers.GetSelectedCount() > 1) { return ctrlUsers.forEachSelectedT(CountAvailable()).available; } else - return ctrlUsers.forEachT(CountAvailable()).available; + return for_each(userMap.begin(), userMap.end(), CountAvailable()).available; } const tstring& getNick(const User::Ptr& u); @@ -311,11 +317,6 @@ TStringMap tabParams; bool tabMenuShown; - typedef vector<Task*> TaskList; - typedef TaskList::iterator TaskIter; - typedef HASH_MAP<User::Ptr, UserInfo*, User::HashFunction> UserMap; - typedef UserMap::iterator UserMapIter; - UserMap userMap; TaskList taskList; CriticalSection taskCS; Modified: dcplusplus/trunk/windows/MainFrm.cpp =================================================================== --- dcplusplus/trunk/windows/MainFrm.cpp 2006-03-18 20:12:05 UTC (rev 595) +++ dcplusplus/trunk/windows/MainFrm.cpp 2006-04-01 18:17:13 UTC (rev 596) @@ -103,7 +103,9 @@ WinUtil::init(m_hWnd); - trayMessage = RegisterWindowMessage(_T("TaskbarCreated")); + //trayMessage = RegisterWindowMessage(_T("TaskbarCreated")); + // Use ASCII version as opencow doesn't support the wide one... + trayMessage = RegisterWindowMessageA("TaskbarCreated"); TimerManager::getInstance()->start(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |