linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #06694
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3222: uniform init for HoldRedraw
------------------------------------------------------------
revno: 3222
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sat 2013-03-16 15:57:07 +0100
message:
uniform init for HoldRedraw
modified:
dwt/src/widgets/RichTextBox.cpp
win32/ADLSearchFrame.cpp
win32/AspectChat.h
win32/DirectoryListingFrame.cpp
win32/FavHubGroupsDlg.cpp
win32/FavHubProperties.cpp
win32/FinishedFrameBase.h
win32/HoldRedraw.h
win32/HubFrame.cpp
win32/PluginPage.cpp
win32/PublicHubsFrame.cpp
win32/QueueFrame.cpp
win32/SearchFrame.cpp
win32/StringListDlg.cpp
win32/SystemFrame.cpp
win32/TransferView.cpp
win32/UCPage.cpp
win32/UserMatchPage.cpp
win32/UsersFrame.cpp
--
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 'dwt/src/widgets/RichTextBox.cpp'
--- dwt/src/widgets/RichTextBox.cpp 2013-01-18 21:28:38 +0000
+++ dwt/src/widgets/RichTextBox.cpp 2013-03-16 14:57:07 +0000
@@ -215,7 +215,7 @@
void RichTextBox::setTextA(const std::string& txt) {
{
- util::HoldRedraw hold(this);
+ util::HoldRedraw hold { this };
setTextEx(txt, ST_DEFAULT);
sendMessage(WM_VSCROLL, SB_TOP);
}
@@ -241,7 +241,7 @@
bool scroll = scrollIsAtEnd();
{
- util::HoldRedraw hold(this);
+ util::HoldRedraw hold { this };
std::pair<int, int> cr = getCaretPosRange();
std::string txt = escapeUnicode(txtRaw);
@@ -359,7 +359,7 @@
}
void RichTextBox::updateColors(COLORREF text, COLORREF background, bool updateFont) {
- util::HoldRedraw hold(this);
+ util::HoldRedraw hold { this };
/* when changing the global formatting of a Rich Edit, its per-character formatting properties
may become funky depending on how they were initially set (the RTF context depth, for example,
=== modified file 'win32/ADLSearchFrame.cpp'
--- win32/ADLSearchFrame.cpp 2013-01-21 18:43:48 +0000
+++ win32/ADLSearchFrame.cpp 2013-03-16 14:57:07 +0000
@@ -189,7 +189,7 @@
save = true;
// Update list control
- HoldRedraw hold(items);
+ HoldRedraw hold { items };
items->erase(i);
addEntry(search, i);
items->select(i);
@@ -204,7 +204,7 @@
ADLSearchManager::SearchCollection& collection = ADLSearchManager::getInstance()->collection;
bool save = false;
- HoldRedraw hold(items);
+ HoldRedraw hold { items };
auto selected = items->getSelection();
for(auto i: selected) {
if(i > 0) {
@@ -226,7 +226,7 @@
ADLSearchManager::SearchCollection& collection = ADLSearchManager::getInstance()->collection;
bool save = false;
- HoldRedraw hold(items);
+ HoldRedraw hold { items };
auto selected = items->getSelection();
for(auto i: selected | boost::adaptors::reversed) {
if(i < items->size() - 1) {
=== modified file 'win32/AspectChat.h'
--- win32/AspectChat.h 2013-01-29 18:08:36 +0000
+++ win32/AspectChat.h 2013-03-16 14:57:07 +0000
@@ -161,7 +161,7 @@
unsigned lineCount = chat->getLineCount();
if(linesToKeep < lineCount) {
{
- HoldRedraw hold(chat);
+ HoldRedraw hold { chat };
chat->setSelection(0, chat->lineIndex(lineCount - linesToKeep));
chat->replaceSelection(_T(""));
}
=== modified file 'win32/DirectoryListingFrame.cpp'
--- win32/DirectoryListingFrame.cpp 2013-01-21 18:43:48 +0000
+++ win32/DirectoryListingFrame.cpp 2013-03-16 14:57:07 +0000
@@ -806,7 +806,7 @@
}
void DirectoryListingFrame::refreshTree(const tstring& root) {
- HoldRedraw hold(dirs);
+ HoldRedraw hold { dirs };
auto ht = findItem(treeRoot, root);
if(!ht) {
ht = treeRoot;
@@ -1251,7 +1251,7 @@
return;
}
- HoldRedraw hold(files);
+ HoldRedraw hold { files };
changeDir(d);
if(!d->getComplete()) {
@@ -1420,9 +1420,9 @@
tstring finalStatus;
ScopedFunctor(([this, &finalStatus] { status->setText(STATUS_STATUS, finalStatus); }));
- HoldRedraw hold(files);
- HoldRedraw hold2(dirs);
- HoldRedraw hold3(status);
+ HoldRedraw hold { files };
+ HoldRedraw hold2 { dirs };
+ HoldRedraw hold3 { status };
auto start = dirs->getSelected();
if(!start)
=== modified file 'win32/FavHubGroupsDlg.cpp'
--- win32/FavHubGroupsDlg.cpp 2013-01-18 21:28:38 +0000
+++ win32/FavHubGroupsDlg.cpp 2013-03-16 14:57:07 +0000
@@ -188,7 +188,7 @@
WinUtil::makeColumns(groups, columns, COLUMN_LAST);
{
- HoldRedraw hold(groups);
+ HoldRedraw hold { groups };
for(auto& i: FavoriteManager::getInstance()->getFavHubGroups())
add(i, false);
@@ -243,7 +243,7 @@
void FavHubGroupsDlg::handleAdd() {
tstring name = edit->getText();
if(addable(name)) {
- HoldRedraw hold(groups);
+ HoldRedraw hold { groups };
add(name, getSettings());
}
}
@@ -264,7 +264,7 @@
i->setGroup(Text::fromT(name));
}
- HoldRedraw hold(groups);
+ HoldRedraw hold { groups };
auto settings = getSettings();
groups->erase(selected);
add(name, std::move(settings));
=== modified file 'win32/FavHubProperties.cpp'
--- win32/FavHubProperties.cpp 2013-01-18 21:28:38 +0000
+++ win32/FavHubProperties.cpp 2013-03-16 14:57:07 +0000
@@ -207,7 +207,7 @@
void FavHubProperties::handleGroups() {
FavHubGroupsDlg(this, entry).run();
- HoldRedraw hold(groups);
+ HoldRedraw hold { groups };
groups->clear();
fillGroups();
}
=== modified file 'win32/FinishedFrameBase.h'
--- win32/FinishedFrameBase.h 2013-01-24 22:53:46 +0000
+++ win32/FinishedFrameBase.h 2013-03-16 14:57:07 +0000
@@ -536,12 +536,12 @@
void updateLists() {
auto lock = FinishedManager::getInstance()->lock();
{
- HoldRedraw hold(files);
+ HoldRedraw hold { files };
for(auto& i: FinishedManager::getInstance()->getMapByFile(in_UL))
addFile(i.first, i.second);
}
{
- HoldRedraw hold(users);
+ HoldRedraw hold { users };
for(auto& i: FinishedManager::getInstance()->getMapByUser(in_UL))
addUser(i.first, i.second);
}
=== modified file 'win32/HoldRedraw.h'
--- win32/HoldRedraw.h 2013-01-18 21:28:38 +0000
+++ win32/HoldRedraw.h 2013-03-16 14:57:07 +0000
@@ -20,6 +20,6 @@
#define DCPLUSPLUS_WIN32_HOLDREDRAW_H_
#include <dwt/util/HoldRedraw.h>
-using dwt::util::HoldRedraw;;
+using dwt::util::HoldRedraw;
#endif /*DCPLUSPLUS_WIN32_HOLDREDRAW_H_*/
=== modified file 'win32/HubFrame.cpp'
--- win32/HubFrame.cpp 2013-01-21 18:43:48 +0000
+++ win32/HubFrame.cpp 2013-03-16 14:57:07 +0000
@@ -621,7 +621,7 @@
updateUsers = false;
auto t = tasks.get();
- HoldRedraw hold(users);
+ HoldRedraw hold { users };
for(auto& i: t) {
if(i.first == UPDATE_USER) {
@@ -1147,7 +1147,7 @@
}
} else {
- HoldRedraw hold(users);
+ HoldRedraw hold { users };
users->clear();
if(filter.empty()) {
=== modified file 'win32/PluginPage.cpp'
--- win32/PluginPage.cpp 2013-01-18 21:28:38 +0000
+++ win32/PluginPage.cpp 2013-03-16 14:57:07 +0000
@@ -183,7 +183,7 @@
ScopedFunctor([&] { pluginInfo->layout(); pluginInfo->redraw(); });
- HoldRedraw hold(pluginInfo);
+ HoldRedraw hold { pluginInfo };
pluginInfo->clearRows();
@@ -288,7 +288,7 @@
auto idx = plugins->getSelected();
if(idx == 0)
return;
- HoldRedraw hold(plugins);
+ HoldRedraw hold { plugins };
PluginManager::getInstance()->movePlugin(idx, -1);
plugins->erase(idx);
idx -=1;
@@ -304,7 +304,7 @@
auto idx = plugins->getSelected();
if(static_cast<uint32_t>(idx) == plugins->size() - 1)
return;
- HoldRedraw hold(plugins);
+ HoldRedraw hold { plugins };
PluginManager::getInstance()->movePlugin(idx, 1);
plugins->erase(idx);
idx +=1;
=== modified file 'win32/PublicHubsFrame.cpp'
--- win32/PublicHubsFrame.cpp 2013-01-21 18:43:48 +0000
+++ win32/PublicHubsFrame.cpp 2013-03-16 14:57:07 +0000
@@ -291,7 +291,7 @@
auto filterPrep = filter.prepare();
auto filterInfoF = [this, &i](int column) { return getText(*i, column); };
- HoldRedraw hold(hubs);
+ HoldRedraw hold { hubs };
hubs->clear();
for(; i != iend; ++i) {
if(filter.empty() || filter.match(filterPrep, filterInfoF)) {
=== modified file 'win32/QueueFrame.cpp'
--- win32/QueueFrame.cpp 2013-01-21 18:43:48 +0000
+++ win32/QueueFrame.cpp 2013-03-16 14:57:07 +0000
@@ -162,8 +162,8 @@
}
void QueueFrame::addQueueList(const QueueItem::StringMap& li) {
- HoldRedraw hold(files);
- HoldRedraw hold2(dirs);
+ HoldRedraw hold { files };
+ HoldRedraw hold2 { dirs };
for(auto& i: li) {
QueueItem* aQI = i.second;
@@ -274,7 +274,7 @@
}
void QueueFrame::updateFiles() {
- HoldRedraw hold(files);
+ HoldRedraw hold { files };
files->clear();
=== modified file 'win32/SearchFrame.cpp'
--- win32/SearchFrame.cpp 2013-03-16 14:40:25 +0000
+++ win32/SearchFrame.cpp 2013-03-16 14:57:07 +0000
@@ -610,7 +610,7 @@
auto filterPrep = filter.prepare();
auto filterInfoF = [this, &i](int column) { return Text::fromT(i->getText(column)); };
- HoldRedraw h(results);
+ HoldRedraw h { results };
results->clear();
for(; i != searchResults.end(); ++i) {
if(filter.empty() || filter.match(filterPrep, filterInfoF)) {
=== modified file 'win32/StringListDlg.cpp'
--- win32/StringListDlg.cpp 2013-01-18 21:28:38 +0000
+++ win32/StringListDlg.cpp 2013-03-16 14:57:07 +0000
@@ -235,7 +235,7 @@
}
void StringListDlg::handleMoveUpClicked() {
- HoldRedraw hold(list);
+ HoldRedraw hold { list };
auto selected = list->getSelection();
for(auto i: selected) {
if(i > 0) {
@@ -248,7 +248,7 @@
}
void StringListDlg::handleMoveDownClicked() {
- HoldRedraw hold(list);
+ HoldRedraw hold { list };
auto selected = list->getSelection();
for(auto i: selected | boost::adaptors::reversed) {
if(i < list->size() - 1) {
=== modified file 'win32/SystemFrame.cpp'
--- win32/SystemFrame.cpp 2013-01-24 22:53:46 +0000
+++ win32/SystemFrame.cpp 2013-03-16 14:57:07 +0000
@@ -70,11 +70,11 @@
void SystemFrame::addLine(time_t t, const tstring& msg) {
bool scroll = log->scrollIsAtEnd();
- HoldRedraw hold(log, !scroll);
+ HoldRedraw hold { log, !scroll };
size_t limit = log->getTextLimit();
if(log->length() + msg.size() > limit) {
- HoldRedraw hold2(log, scroll);
+ HoldRedraw hold2 { log, scroll };
log->setSelection(0, log->lineIndex(log->lineFromChar(limit / 10)));
log->replaceSelection(_T(""));
}
=== modified file 'win32/TransferView.cpp'
--- win32/TransferView.cpp 2013-01-23 23:24:26 +0000
+++ win32/TransferView.cpp 2013-03-16 14:57:07 +0000
@@ -475,8 +475,8 @@
bool sortConn = false;
bool sortDown = false;
- HoldRedraw hold(connections, t.size() > 1);
- HoldRedraw hold2(downloads, t.size() > 1);
+ HoldRedraw hold { connections, t.size() > 1 };
+ HoldRedraw hold2 { downloads, t.size() > 1 };
for(auto& i: t) {
if(i.first == CONNECTIONS_ADD) {
=== modified file 'win32/UCPage.cpp'
--- win32/UCPage.cpp 2013-01-18 21:28:38 +0000
+++ win32/UCPage.cpp 2013-03-16 14:57:07 +0000
@@ -155,7 +155,7 @@
return;
auto n = commands->getData(i);
FavoriteManager::getInstance()->moveUserCommand(n, -1);
- HoldRedraw hold(commands);
+ HoldRedraw hold { commands };
commands->erase(i);
UserCommand uc;
FavoriteManager::getInstance()->getUserCommand(n, uc);
@@ -172,7 +172,7 @@
return;
auto n = commands->getData(i);
FavoriteManager::getInstance()->moveUserCommand(n, 1);
- HoldRedraw hold(commands);
+ HoldRedraw hold { commands };
commands->erase(i);
UserCommand uc;
FavoriteManager::getInstance()->getUserCommand(n, uc);
=== modified file 'win32/UserMatchPage.cpp'
--- win32/UserMatchPage.cpp 2013-01-18 21:28:38 +0000
+++ win32/UserMatchPage.cpp 2013-03-16 14:57:07 +0000
@@ -268,7 +268,7 @@
}
void UserMatchPage::handleMoveUpClicked() {
- HoldRedraw hold(table);
+ HoldRedraw hold { table };
auto sel = table->getSelection();
for(auto i: sel) {
if(i > 0) {
@@ -285,7 +285,7 @@
}
void UserMatchPage::handleMoveDownClicked() {
- HoldRedraw hold(table);
+ HoldRedraw hold { table };
auto sel = table->getSelection();
for(auto i: sel | boost::adaptors::reversed) {
if(i < table->size() - 1) {
=== modified file 'win32/UsersFrame.cpp'
--- win32/UsersFrame.cpp 2013-01-21 18:43:48 +0000
+++ win32/UsersFrame.cpp 2013-03-16 14:57:07 +0000
@@ -339,7 +339,7 @@
ScopedFunctor([&] { scroll->layout(); userInfo->layout(); userInfo->redraw(); });
- HoldRedraw hold(userInfo);
+ HoldRedraw hold { userInfo };
// Clear old items
auto children = userInfo->getChildren<Control>();
@@ -507,7 +507,7 @@
auto filterPrep = filter.prepare();
auto filterInfoF = [this, &i](int column) { return Text::fromT(i->second.getText(column)); };
- HoldRedraw h(users);
+ HoldRedraw h { users };
users->clear();
for(; i != userInfos.end(); ++i) {
if((filter.empty() || filter.match(filterPrep, filterInfoF)) && show(i->second.getUser(), false)) {