mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-12 07:59:29 -05:00
optim: changed postfixed ++ into prefix++ for non trivial operators, replaced test on std::list::size() by std::list::empty() (Patch from Phenom, modified)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7627 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
491a655889
commit
b593a918a0
@ -274,7 +274,7 @@ bool p3BitDht::loadList(std::list<RsItem *>& load)
|
||||
std::cerr << "p3BitDht::loadList()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
if ((load.size() == 0) || (load.size() > 1))
|
||||
if (load.empty() || (load.size() > 1))
|
||||
{
|
||||
/* error */
|
||||
std::cerr << "p3BitDht::loadList() Error only expecting 1 item";
|
||||
|
@ -1213,7 +1213,7 @@ bool ftController::FileRequest(const std::string& fname, const RsFileHash& hash
|
||||
setPeerState(dit->second->mTransfer, *it, rate, mServiceCtrl->isPeerConnected(mFtServiceId, *it));
|
||||
}
|
||||
|
||||
if (srcIds.size() == 0)
|
||||
if (srcIds.empty())
|
||||
{
|
||||
#ifdef CONTROL_DEBUG
|
||||
std::cerr << "ftController::FileRequest() WARNING: No Src Peers";
|
||||
|
@ -315,7 +315,7 @@ bool ftDataMultiplex::doWork()
|
||||
|
||||
{
|
||||
RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/
|
||||
if (mRequestQueue.size() == 0)
|
||||
if (mRequestQueue.empty())
|
||||
{
|
||||
doRequests = false;
|
||||
continue;
|
||||
@ -385,7 +385,7 @@ bool ftDataMultiplex::doWork()
|
||||
|
||||
{
|
||||
RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/
|
||||
if (mSearchQueue.size() == 0)
|
||||
if (mSearchQueue.empty())
|
||||
{
|
||||
/* Finished */
|
||||
return true;
|
||||
|
@ -114,7 +114,7 @@ void ftExtraList::hashAFile()
|
||||
{
|
||||
RsStackMutex stack(extMutex);
|
||||
|
||||
if (mToHash.size() == 0)
|
||||
if (mToHash.empty())
|
||||
return;
|
||||
|
||||
details = mToHash.front();
|
||||
|
@ -376,7 +376,7 @@ int ftFileCreator::locked_notifyReceived(uint64_t offset, uint32_t chunk_size)
|
||||
// all parts are obtained.
|
||||
// - new parts arriving in the second part cannot interfere since they should come in order.
|
||||
|
||||
(*chunk.ref_cnt)++ ;
|
||||
++(*chunk.ref_cnt) ;
|
||||
|
||||
#ifdef FILE_DEBUG
|
||||
std::cerr << "Created two sub chunks. Ref_cnt = " << *chunk.ref_cnt << std::endl;
|
||||
|
@ -1633,7 +1633,7 @@ bool p3PeerMgrIMPL::loadList(std::list<RsItem *>& load)
|
||||
std::string proxyIpAddress = kConfigDefaultProxyServerIpAddr;
|
||||
uint16_t proxyPort = kConfigDefaultProxyServerPort;
|
||||
|
||||
if (load.size() == 0) {
|
||||
if (load.empty()) {
|
||||
std::cerr << "p3PeerMgrIMPL::loadList() list is empty, it may be a configuration problem." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
@ -487,13 +487,13 @@ int pqihandler::UpdateRates()
|
||||
float crate_in = mod -> pqi -> getRate(true);
|
||||
if (crate_in > 0.01 * avail_in || crate_in > 0.1)
|
||||
{
|
||||
effectiveDownloadsSm ++;
|
||||
++effectiveDownloadsSm;
|
||||
}
|
||||
|
||||
float crate_out = mod -> pqi -> getRate(false);
|
||||
if (crate_out > 0.01 * avail_out || crate_out > 0.1)
|
||||
{
|
||||
effectiveUploadsSm ++;
|
||||
++effectiveUploadsSm;
|
||||
}
|
||||
|
||||
used_bw_in += crate_in;
|
||||
|
@ -141,7 +141,7 @@ int p3ChatService::tick()
|
||||
std::vector<VisibleChatLobbyRecord> visible_lobbies_tmp ;
|
||||
getListOfNearbyChatLobbies(visible_lobbies_tmp) ;
|
||||
|
||||
if (visible_lobbies_tmp.size()==0){
|
||||
if (visible_lobbies_tmp.empty()){
|
||||
last_req_chat_lobby_list = now-LOBBY_LIST_AUTO_UPDATE_TIME+MIN_DELAY_BETWEEN_PUBLIC_LOBBY_REQ;
|
||||
} else {
|
||||
last_req_chat_lobby_list = now ;
|
||||
@ -1467,7 +1467,7 @@ bool p3ChatService::getPublicChatQueue(std::list<ChatInfo> &chats)
|
||||
RsStackMutex stack(mChatMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
// get the items from the public list.
|
||||
if (publicList.size() == 0) {
|
||||
if (publicList.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -777,24 +777,24 @@ void p3MsgService::getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxN
|
||||
initRsMIS(mit->second, mis);
|
||||
|
||||
if (mis.msgflags & RS_MSG_TRASH) {
|
||||
if (pnTrashbox) (*pnTrashbox)++;
|
||||
if (pnTrashbox) ++(*pnTrashbox);
|
||||
continue;
|
||||
}
|
||||
switch (mis.msgflags & RS_MSG_BOXMASK) {
|
||||
case RS_MSG_INBOX:
|
||||
if (pnInbox) (*pnInbox)++;
|
||||
if (pnInbox) ++(*pnInbox);
|
||||
if ((mis.msgflags & RS_MSG_NEW) == RS_MSG_NEW) {
|
||||
if (pnInboxNew) (*pnInboxNew)++;
|
||||
if (pnInboxNew) ++(*pnInboxNew);
|
||||
}
|
||||
break;
|
||||
case RS_MSG_OUTBOX:
|
||||
if (pnOutbox) (*pnOutbox)++;
|
||||
if (pnOutbox) ++(*pnOutbox);
|
||||
break;
|
||||
case RS_MSG_DRAFTBOX:
|
||||
if (pnDraftbox) (*pnDraftbox)++;
|
||||
if (pnDraftbox) ++(*pnDraftbox);
|
||||
break;
|
||||
case RS_MSG_SENTBOX:
|
||||
if (pnSentbox) (*pnSentbox)++;
|
||||
if (pnSentbox) ++(*pnSentbox);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1248,7 +1248,7 @@ bool p3MsgService::removeMessageTagType(uint32_t tagId)
|
||||
if (lit != tag->tagIds.end()) {
|
||||
tag->tagIds.erase(lit);
|
||||
|
||||
if (tag->tagIds.size() == 0) {
|
||||
if (tag->tagIds.empty()) {
|
||||
/* remove empty tag */
|
||||
delete(tag);
|
||||
|
||||
@ -1360,7 +1360,7 @@ bool p3MsgService::setMessageTag(const std::string &msgId, uint32_t tagId, bool
|
||||
tag->tagIds.erase(lit);
|
||||
nNotifyType = NOTIFY_TYPE_DEL;
|
||||
|
||||
if (tag->tagIds.size() == 0) {
|
||||
if (tag->tagIds.empty()) {
|
||||
/* remove empty tag */
|
||||
delete(tag);
|
||||
mMsgTags.erase(mit);
|
||||
|
@ -42,7 +42,7 @@ RsItem *p3Service::recvItem()
|
||||
{
|
||||
RsStackMutex stack(srvMtx); /***** LOCK MUTEX *****/
|
||||
|
||||
if (recv_queue.size() == 0)
|
||||
if (recv_queue.empty())
|
||||
{
|
||||
return NULL; /* nothing there! */
|
||||
}
|
||||
|
@ -914,7 +914,7 @@ bool TcpStream::widle()
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((lastWriteTF == int_wbytes()) && (inSize + inQueue.size() == 0))
|
||||
if ((lastWriteTF == int_wbytes()) && (inSize == 0) && inQueue.empty())
|
||||
{
|
||||
wcount++;
|
||||
if (wcount > ilevel)
|
||||
@ -2438,7 +2438,7 @@ int TcpStream::send()
|
||||
}
|
||||
|
||||
/* if inqueue empty, and enough window space, send partial stuff */
|
||||
if ((!sent) && (inQueue.size() == 0) && (maxsend >= inSize) && (inSize))
|
||||
if ((!sent) && (inQueue.empty()) && (maxsend >= inSize) && (inSize))
|
||||
{
|
||||
TcpPacket *pkt = new TcpPacket(inData, inSize);
|
||||
#ifdef DEBUG_TCP_STREAM
|
||||
|
@ -480,8 +480,8 @@ int UdpRelayReceiver::installRelayClass_relayLocked(int &classIdx, uint32_t &ban
|
||||
std::cerr << std::endl;
|
||||
|
||||
/* if we get here we can add one */
|
||||
mClassCount[UDP_RELAY_CLASS_ALL]++;
|
||||
mClassCount[classIdx]++;
|
||||
++mClassCount[UDP_RELAY_CLASS_ALL];
|
||||
++mClassCount[classIdx];
|
||||
bandwidth = mClassBandwidth[classIdx];
|
||||
|
||||
return 1;
|
||||
|
@ -475,7 +475,7 @@ int p3ZeroConf::checkLocationResults()
|
||||
RsStackMutex stack(mZcMtx); /****** STACK LOCK MUTEX *******/
|
||||
|
||||
/* check the results Queue */
|
||||
if (mLocationResults.size() == 0)
|
||||
if (mLocationResults.empty())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -538,7 +538,7 @@ int p3ZeroConf::checkQueryResults()
|
||||
RsStackMutex stack(mZcMtx); /****** STACK LOCK MUTEX *******/
|
||||
|
||||
/* check the results Queue */
|
||||
if (mQueryResults.size() == 0)
|
||||
if (mQueryResults.empty())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ void AWidget::calcWater(int npage, int density) {
|
||||
}
|
||||
|
||||
for (int y = (h-1)*w; count < y; count += 2) {
|
||||
for (int x = count+w-2; count < x; count++) {
|
||||
for (int x = count+w-2; count < x; ++count) {
|
||||
// This does the eight-pixel method. It looks much better.
|
||||
int newh = ((oldptr[count + w]
|
||||
+ oldptr[count - w]
|
||||
@ -308,9 +308,9 @@ void AWidget::addBlob(int x, int y, int radius, int height) {
|
||||
if (x + radius > w-1) right -= (x+radius-w+1);
|
||||
if (y + radius > h-1) bottom-= (y+radius-h+1);
|
||||
|
||||
for(int cy = top; cy < bottom; cy++) {
|
||||
for(int cy = top; cy < bottom; ++cy) {
|
||||
int cyq = cy*cy;
|
||||
for(int cx = left; cx < right; cx++) {
|
||||
for(int cx = left; cx < right; ++cx) {
|
||||
if (cx*cx + cyq < rquad) {
|
||||
newptr[w*(cy+y) + (cx+x)] += height;
|
||||
}
|
||||
@ -330,7 +330,7 @@ void AWidget::drawWater(QRgb* srcImage,QRgb* dstImage) {
|
||||
int *ptr = &heightField1.front();
|
||||
|
||||
for (int y = (h-1)*w; offset < y; offset += 2) {
|
||||
for (int x = offset+w-2; offset < x; offset++) {
|
||||
for (int x = offset+w-2; offset < x; ++offset) {
|
||||
int dx = ptr[offset] - ptr[offset+1];
|
||||
int dy = ptr[offset] - ptr[offset+w];
|
||||
|
||||
@ -340,7 +340,7 @@ void AWidget::drawWater(QRgb* srcImage,QRgb* dstImage) {
|
||||
c = shiftColor(c, dx);
|
||||
dstImage[offset] = c;
|
||||
}
|
||||
offset++;
|
||||
++offset;
|
||||
dx = ptr[offset] - ptr[offset+1];
|
||||
dy = ptr[offset] - ptr[offset+w];
|
||||
|
||||
@ -509,7 +509,7 @@ void TBoard::dropDown() {
|
||||
break;
|
||||
}
|
||||
newY--;
|
||||
dropHeight++;
|
||||
++dropHeight;
|
||||
}
|
||||
pieceDropped(dropHeight);
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ void ChatLobbyWidget::updateDisplay()
|
||||
}
|
||||
}
|
||||
}
|
||||
childIndex++;
|
||||
++childIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@ -431,7 +431,7 @@ void ChatLobbyWidget::updateDisplay()
|
||||
// Search existing item
|
||||
//
|
||||
int childCnt = lobby_other_item->childCount();
|
||||
for (int childIndex = 0; childIndex < childCnt; childIndex++)
|
||||
for (int childIndex = 0; childIndex < childCnt; ++childIndex)
|
||||
{
|
||||
QTreeWidgetItem *itemLoop = lobby_other_item->child(childIndex);
|
||||
if (itemLoop->type() == TYPE_LOBBY && itemLoop->data(COLUMN_DATA, ROLE_ID).toULongLong() == lobby.lobby_id) {
|
||||
@ -441,7 +441,7 @@ void ChatLobbyWidget::updateDisplay()
|
||||
}
|
||||
}
|
||||
childCnt = lobby_item->childCount();
|
||||
for (int childIndex = 0; childIndex < childCnt; childIndex++)
|
||||
for (int childIndex = 0; childIndex < childCnt; ++childIndex)
|
||||
{
|
||||
QTreeWidgetItem *itemLoop = lobby_item->child(childIndex);
|
||||
if (itemLoop->type() == TYPE_LOBBY && itemLoop->data(COLUMN_DATA, ROLE_ID).toULongLong() == lobby.lobby_id) {
|
||||
@ -509,7 +509,7 @@ void ChatLobbyWidget::updateDisplay()
|
||||
|
||||
// search existing item
|
||||
int childCount = itemParent->childCount();
|
||||
for (int childIndex = 0; childIndex < childCount; childIndex++) {
|
||||
for (int childIndex = 0; childIndex < childCount; ++childIndex) {
|
||||
QTreeWidgetItem *itemLoop = itemParent->child(childIndex);
|
||||
if (itemLoop->type() == TYPE_LOBBY && itemLoop->data(COLUMN_DATA, ROLE_ID).toULongLong() == lobby.lobby_id) {
|
||||
item = itemLoop;
|
||||
@ -853,7 +853,7 @@ void ChatLobbyWidget::filterItems(const QString &text)
|
||||
int filterColumn = ui.filterLineEdit->currentFilter();
|
||||
|
||||
int count = ui.lobbyTreeWidget->topLevelItemCount ();
|
||||
for (int index = 0; index < count; index++) {
|
||||
for (int index = 0; index < count; ++index) {
|
||||
filterItem(ui.lobbyTreeWidget->topLevelItem(index), text, filterColumn);
|
||||
}
|
||||
}
|
||||
@ -870,9 +870,9 @@ bool ChatLobbyWidget::filterItem(QTreeWidgetItem *item, const QString &text, int
|
||||
|
||||
int visibleChildCount = 0;
|
||||
int count = item->childCount();
|
||||
for (int index = 0; index < count; index++) {
|
||||
for (int index = 0; index < count; ++index) {
|
||||
if (filterItem(item->child(index), text, filterColumn)) {
|
||||
visibleChildCount++;
|
||||
++visibleChildCount;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ void CirclesDialog::reloadAll()
|
||||
fofItem->setText(0, tr("Friends Of Friends"));
|
||||
ui.treeWidget_friends->addTopLevelItem(fofItem);
|
||||
|
||||
for(it = friend_pgpIds.begin(); it != friend_pgpIds.end(); it++)
|
||||
for(it = friend_pgpIds.begin(); it != friend_pgpIds.end(); ++it)
|
||||
{
|
||||
RsPeerDetails details;
|
||||
if (rsPeers->getGPGDetails(*it, details))
|
||||
@ -180,7 +180,7 @@ void CirclesDialog::reloadAll()
|
||||
}
|
||||
}
|
||||
|
||||
for(it = all_pgpIds.begin(); it != all_pgpIds.end(); it++)
|
||||
for(it = all_pgpIds.begin(); it != all_pgpIds.end(); ++it)
|
||||
{
|
||||
if (friend_set.end() != friend_set.find(*it))
|
||||
{
|
||||
@ -228,7 +228,7 @@ void set_item_background(QTreeWidgetItem *item, uint32_t type)
|
||||
void update_children_background(QTreeWidgetItem *item, uint32_t type)
|
||||
{
|
||||
int count = item->childCount();
|
||||
for(int i = 0; i < count; i++)
|
||||
for(int i = 0; i < count; ++i)
|
||||
{
|
||||
QTreeWidgetItem *child = item->child(i);
|
||||
|
||||
@ -247,7 +247,7 @@ void set_tree_background(QTreeWidget *tree, uint32_t type)
|
||||
|
||||
/* grab all toplevel */
|
||||
int count = tree->topLevelItemCount();
|
||||
for(int i = 0; i < count; i++)
|
||||
for(int i = 0; i < count; ++i)
|
||||
{
|
||||
QTreeWidgetItem *item = tree->topLevelItem(i);
|
||||
/* resursively clear child backgrounds */
|
||||
@ -271,7 +271,7 @@ void check_mark_item(QTreeWidgetItem *item, const std::set<RsPgpId> &names, uint
|
||||
void update_mark_children(QTreeWidgetItem *item, const std::set<RsPgpId> &names, uint32_t col, uint32_t type)
|
||||
{
|
||||
int count = item->childCount();
|
||||
for(int i = 0; i < count; i++)
|
||||
for(int i = 0; i < count; ++i)
|
||||
{
|
||||
QTreeWidgetItem *child = item->child(i);
|
||||
|
||||
@ -290,7 +290,7 @@ void mark_matching_tree(QTreeWidget *tree, const std::set<RsPgpId> &names, uint3
|
||||
|
||||
/* grab all toplevel */
|
||||
int count = tree->topLevelItemCount();
|
||||
for(int i = 0; i < count; i++)
|
||||
for(int i = 0; i < count; ++i)
|
||||
{
|
||||
QTreeWidgetItem *item = tree->topLevelItem(i);
|
||||
/* resursively clear child backgrounds */
|
||||
@ -308,7 +308,7 @@ void mark_circle_item(QTreeWidgetItem *item, const std::set<RsPgpId> &names)
|
||||
if (rsGxsCircles->getCircleDetails(id, details))
|
||||
{
|
||||
std::set<RsPgpId>::iterator it;
|
||||
for(it = names.begin(); it != names.end(); it++)
|
||||
for(it = names.begin(); it != names.end(); ++it)
|
||||
{
|
||||
if (details.mAllowedPeers.end() != details.mAllowedPeers.find(*it))
|
||||
{
|
||||
@ -329,7 +329,7 @@ void mark_circle_item(QTreeWidgetItem *item, const std::set<RsPgpId> &names)
|
||||
void mark_circle_children(QTreeWidgetItem *item, const std::set<RsPgpId> &names)
|
||||
{
|
||||
int count = item->childCount();
|
||||
for(int i = 0; i < count; i++)
|
||||
for(int i = 0; i < count; ++i)
|
||||
{
|
||||
QTreeWidgetItem *child = item->child(i);
|
||||
|
||||
@ -348,7 +348,7 @@ void mark_circle_tree(QTreeWidget *tree, const std::set<RsPgpId> &names)
|
||||
|
||||
/* grab all toplevel */
|
||||
int count = tree->topLevelItemCount();
|
||||
for(int i = 0; i < count; i++)
|
||||
for(int i = 0; i < count; ++i)
|
||||
{
|
||||
QTreeWidgetItem *item = tree->topLevelItem(i);
|
||||
mark_circle_children(item, names);
|
||||
@ -384,7 +384,7 @@ void CirclesDialog::circle_selected()
|
||||
/* now mark all the members */
|
||||
std::set<RsPgpId> members;
|
||||
std::map<RsPgpId, std::list<RsGxsId> >::iterator it;
|
||||
for(it = details.mAllowedPeers.begin(); it != details.mAllowedPeers.end(); it++)
|
||||
for(it = details.mAllowedPeers.begin(); it != details.mAllowedPeers.end(); ++it)
|
||||
{
|
||||
members.insert(it->first);
|
||||
std::cerr << "Circle member: " << it->first;
|
||||
@ -629,7 +629,7 @@ void CirclesDialog::loadGroupMeta(const uint32_t &token)
|
||||
externalOtherCirclesItem->setText(0, tr("External Circles (Other)"));
|
||||
ui.treeWidget_membership->addTopLevelItem(externalOtherCirclesItem);
|
||||
|
||||
for(vit = groupInfo.begin(); vit != groupInfo.end(); vit++)
|
||||
for(vit = groupInfo.begin(); vit != groupInfo.end(); ++vit)
|
||||
{
|
||||
/* Add Widget, and request Pages */
|
||||
std::cerr << "CirclesDialog::loadGroupMeta() GroupId: " << vit->mGroupId;
|
||||
|
@ -206,14 +206,14 @@ void CreateCircleDialog::addMember(const QString& keyId, const QString& idtype,
|
||||
QTreeWidget *tree = ui.treeWidget_membership;
|
||||
|
||||
int count = tree->topLevelItemCount();
|
||||
for(int i = 0; i < count; i++){
|
||||
for(int i = 0; i < count; ++i){
|
||||
QTreeWidgetItem *item = tree->topLevelItem(i);
|
||||
if (keyId == item->text(RSCIRCLEID_COL_KEYID)) {
|
||||
std::cerr << "CreateCircleDialog::addMember() Already is a Member: " << keyId.toStdString();
|
||||
std::cerr << std::endl;
|
||||
return;
|
||||
}//if (keyId == item->text(RSCIRCLEID_COL_KEYID))
|
||||
}//for(int i = 0; i < count; i++)
|
||||
}//for(int i = 0; i < count; ++i)
|
||||
|
||||
QTreeWidgetItem *member = new QTreeWidgetItem();
|
||||
member->setText(RSCIRCLEID_COL_NICKNAME, nickname);
|
||||
@ -308,7 +308,7 @@ void CreateCircleDialog::createCircle()
|
||||
/* copy Ids from GUI */
|
||||
QTreeWidget *tree = ui.treeWidget_membership;
|
||||
int count = tree->topLevelItemCount();
|
||||
for(int i = 0; i < count; i++) {
|
||||
for(int i = 0; i < count; ++i) {
|
||||
QTreeWidgetItem *item = tree->topLevelItem(i);
|
||||
QString keyId = item->text(RSCIRCLEID_COL_KEYID);
|
||||
|
||||
@ -323,7 +323,7 @@ void CreateCircleDialog::createCircle()
|
||||
std::cerr << std::endl;
|
||||
}//else (mIsExternalCircle)
|
||||
|
||||
}//for(int i = 0; i < count; i++)
|
||||
}//for(int i = 0; i < count; ++i)
|
||||
|
||||
if (mIsExistingCircle) {
|
||||
std::cerr << "CreateCircleDialog::createCircle() Existing Circle TODO";
|
||||
@ -510,7 +510,7 @@ void CreateCircleDialog::getPgpIdentities()
|
||||
std::list<RsPgpId>::iterator it;
|
||||
|
||||
rsPeers->getGPGAcceptedList(ids);
|
||||
for(it = ids.begin(); it != ids.end(); it++) {
|
||||
for(it = ids.begin(); it != ids.end(); ++it) {
|
||||
RsPeerDetails details;
|
||||
|
||||
rsPeers->getGPGDetails(*it, details);
|
||||
@ -535,7 +535,7 @@ void CreateCircleDialog::getPgpIdentities()
|
||||
addMember(keyId, idtype, nickname);
|
||||
}//if (it != mCircleGroup.mLocalFriends.end())
|
||||
}//if (mIsExistingCircle)
|
||||
}//for(it = ids.begin(); it != ids.end(); it++)
|
||||
}//for(it = ids.begin(); it != ids.end(); ++it)
|
||||
|
||||
filterIds();
|
||||
}
|
||||
@ -575,7 +575,7 @@ void CreateCircleDialog::loadIdentities(uint32_t token)
|
||||
return;
|
||||
}//if (!rsIdentity->getGroupData(token, datavector))
|
||||
|
||||
for(vit = datavector.begin(); vit != datavector.end(); vit++) {
|
||||
for(vit = datavector.begin(); vit != datavector.end(); ++vit) {
|
||||
data = (*vit);
|
||||
|
||||
/* do filtering */
|
||||
@ -628,7 +628,7 @@ void CreateCircleDialog::loadIdentities(uint32_t token)
|
||||
addMember(keyId, idtype, nickname);
|
||||
}//if (it != mCircleGroup.mInvitedMembers.end())
|
||||
}//if (mIsExistingCircle)
|
||||
}//for(vit = datavector.begin(); vit != datavector.end(); vit++)
|
||||
}//for(vit = datavector.begin(); vit != datavector.end(); ++vit)
|
||||
}
|
||||
|
||||
void CreateCircleDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
|
@ -671,7 +671,7 @@ void TransfersDialog::downloadListCustomPopupMenu( QPoint /*point*/ )
|
||||
QModelIndexList lst = ui.downloadList->selectionModel ()->selectedIndexes ();
|
||||
|
||||
//Look for all selected items
|
||||
for (int i = 0; i < lst.count(); i++) {
|
||||
for (int i = 0; i < lst.count(); ++i) {
|
||||
//Look only for first column == File List
|
||||
if ( lst[i].column() == 0) {
|
||||
//Get Info for current item
|
||||
@ -718,7 +718,7 @@ void TransfersDialog::downloadListCustomPopupMenu( QPoint /*point*/ )
|
||||
|
||||
}// if (rsFiles->FileDetails(lst[i].data(COLUMN_ID), RS_FILE_HINTS_DOWNLOAD, info))
|
||||
}// if (lst[i].column() == 0)
|
||||
}// for (int i = 0; i < lst.count(); i++)
|
||||
}// for (int i = 0; i < lst.count(); ++i)
|
||||
}// if (!items.empty())
|
||||
|
||||
if (atLeastOne_Downloading) {
|
||||
@ -1063,7 +1063,7 @@ int TransfersDialog::addItem(int row, const FileInfo &fileInfo)
|
||||
|
||||
/* get the sources (number of online peers) */
|
||||
if (transferInfo.tfRate > 0 && fileInfo.downloadStatus == FT_STATE_DOWNLOADING)
|
||||
active++;
|
||||
++active;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1318,7 +1318,7 @@ void TransfersDialog::insertTransfers()
|
||||
|
||||
std::set<std::string> used_hashes ;
|
||||
|
||||
for(it = upHashes.begin(); it != upHashes.end(); it++)
|
||||
for(it = upHashes.begin(); it != upHashes.end(); ++it)
|
||||
{
|
||||
FileInfo info;
|
||||
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_UPLOAD, info))
|
||||
@ -1328,7 +1328,7 @@ void TransfersDialog::insertTransfers()
|
||||
continue ;
|
||||
|
||||
std::list<TransferInfo>::iterator pit;
|
||||
for(pit = info.peers.begin(); pit != info.peers.end(); pit++)
|
||||
for(pit = info.peers.begin(); pit != info.peers.end(); ++pit)
|
||||
{
|
||||
if (pit->peerId == ownId) //don't display transfer to ourselves
|
||||
continue ;
|
||||
@ -1401,7 +1401,7 @@ void TransfersDialog::insertTransfers()
|
||||
ULListModel->removeRow(removeIndex);
|
||||
rowCount = ULListModel->rowCount();
|
||||
} else
|
||||
removeIndex++;
|
||||
++removeIndex;
|
||||
}
|
||||
|
||||
ui.uploadsList->setSortingEnabled(true);
|
||||
@ -1433,7 +1433,7 @@ void TransfersDialog::cancel()
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
for (it = items.begin(); it != items.end(); ++it) {
|
||||
if (first) {
|
||||
first = false;
|
||||
QString queryWrn2;
|
||||
@ -1481,7 +1481,7 @@ void TransfersDialog::copyLink ()
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
for (it = items.begin(); it != items.end(); ++it) {
|
||||
FileInfo info;
|
||||
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, info)) {
|
||||
continue;
|
||||
@ -1504,7 +1504,7 @@ void TransfersDialog::ulCopyLink ()
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getULSelectedItems(&items, NULL);
|
||||
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
for (it = items.begin(); it != items.end(); ++it) {
|
||||
FileInfo info;
|
||||
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_UPLOAD, info)) {
|
||||
continue;
|
||||
@ -1564,7 +1564,7 @@ void TransfersDialog::getSelectedItems(std::set<RsFileHash> *ids, std::set<int>
|
||||
if (rows) rows->clear();
|
||||
|
||||
int i, imax = DLListModel->rowCount();
|
||||
for (i = 0; i < imax; i++) {
|
||||
for (i = 0; i < imax; ++i) {
|
||||
bool isParentSelected = false;
|
||||
bool isChildSelected = false;
|
||||
|
||||
@ -1575,7 +1575,7 @@ void TransfersDialog::getSelectedItems(std::set<RsFileHash> *ids, std::set<int>
|
||||
isParentSelected = true;
|
||||
} else {
|
||||
int j, jmax = parent->rowCount();
|
||||
for (j = 0; j < jmax && !isChildSelected; j++) {
|
||||
for (j = 0; j < jmax && !isChildSelected; ++j) {
|
||||
QStandardItem *child = parent->child(j);
|
||||
if (!child) continue;
|
||||
QModelIndex cindex = child->index();
|
||||
@ -1631,7 +1631,7 @@ bool TransfersDialog::controlTransferFile(uint32_t flags)
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
for (it = items.begin(); it != items.end(); ++it) {
|
||||
result &= rsFiles->FileControl(*it, flags);
|
||||
}
|
||||
|
||||
@ -1661,7 +1661,7 @@ void TransfersDialog::openFolderTransfer()
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
for (it = items.begin(); it != items.end(); ++it) {
|
||||
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, info)) continue;
|
||||
break;
|
||||
}
|
||||
@ -1691,7 +1691,7 @@ void TransfersDialog::ulOpenFolder()
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getULSelectedItems(&items, NULL);
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
for (it = items.begin(); it != items.end(); ++it) {
|
||||
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_UPLOAD, info)) continue;
|
||||
break;
|
||||
}
|
||||
@ -1718,7 +1718,7 @@ void TransfersDialog::previewTransfer()
|
||||
std::set<RsFileHash> items;
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
for (it = items.begin(); it != items.end(); ++it) {
|
||||
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, info)) continue;
|
||||
break;
|
||||
}
|
||||
@ -1788,7 +1788,7 @@ void TransfersDialog::openTransfer()
|
||||
std::set<RsFileHash> items ;
|
||||
std::set<RsFileHash>::iterator it ;
|
||||
getSelectedItems(&items, NULL);
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
for (it = items.begin(); it != items.end(); ++it) {
|
||||
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, info)) continue;
|
||||
break;
|
||||
}
|
||||
@ -1820,7 +1820,7 @@ void TransfersDialog::openTransfer()
|
||||
// std::set<QStandardItem *>::iterator it;
|
||||
// getSelectedItems(&items, NULL);
|
||||
//
|
||||
// for (it = items.begin(); it != items.end(); it ++) {
|
||||
// for (it = items.begin(); it != items.end(); ++it) {
|
||||
// std::string hash = (*it)->data(Qt::DisplayRole).toString().toStdString();
|
||||
// rsFiles->clearDownload(hash);
|
||||
// }
|
||||
@ -1848,7 +1848,7 @@ void TransfersDialog::setChunkStrategy(FileChunksInfo::ChunkStrategy s)
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
for (it = items.begin(); it != items.end(); ++it) {
|
||||
rsFiles->setChunkStrategy(*it, s);
|
||||
}
|
||||
}
|
||||
@ -1889,7 +1889,7 @@ void TransfersDialog::changeSpeed(int speed)
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
|
||||
for (it = items.begin(); it != items.end(); it ++)
|
||||
for (it = items.begin(); it != items.end(); ++it)
|
||||
{
|
||||
rsFiles->changeDownloadSpeed(*it, speed);
|
||||
}
|
||||
@ -1954,7 +1954,7 @@ void TransfersDialog::changeQueuePosition(QueueMove mv)
|
||||
std::set<RsFileHash>::iterator it;
|
||||
getSelectedItems(&items, NULL);
|
||||
|
||||
for (it = items.begin(); it != items.end(); it ++)
|
||||
for (it = items.begin(); it != items.end(); ++it)
|
||||
{
|
||||
rsFiles->changeQueuePosition(*it, mv);
|
||||
}
|
||||
@ -1971,7 +1971,7 @@ void TransfersDialog::showFileDetails()
|
||||
RsFileHash file_hash ;
|
||||
int nb_select = 0 ;
|
||||
|
||||
for(int i = 0; i <= DLListModel->rowCount(); i++)
|
||||
for(int i = 0; i <= DLListModel->rowCount(); ++i)
|
||||
if(selection->isRowSelected(i, QModelIndex()))
|
||||
{
|
||||
file_hash = RsFileHash(getID(i, DLListModel).toStdString());
|
||||
@ -2065,7 +2065,7 @@ void TransfersDialog::collCreate()
|
||||
std::set<RsFileHash>::iterator it ;
|
||||
getSelectedItems(&items, NULL);
|
||||
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
for (it = items.begin(); it != items.end(); ++it) {
|
||||
FileInfo info;
|
||||
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, info)) continue;
|
||||
|
||||
|
@ -155,7 +155,7 @@ FriendsDialog::FriendsDialog(QWidget *parent)
|
||||
rsHistory->getMessages(RsPeerId(), historyMsgs, messageCount);
|
||||
|
||||
std::list<HistoryMsg>::iterator it;
|
||||
for (it = historyMsgs.begin(); it != historyMsgs.end(); it++) {
|
||||
for (it = historyMsgs.begin(); it != historyMsgs.end(); ++it) {
|
||||
addChatMsg(it->incoming, true, QString::fromUtf8(it->peerName.c_str()), QDateTime::fromTime_t(it->sendTime), QDateTime::fromTime_t(it->recvTime), QString::fromUtf8(it->message.c_str()));
|
||||
}
|
||||
}
|
||||
@ -501,7 +501,7 @@ void FriendsDialog::insertChat()
|
||||
std::list<ChatInfo>::iterator it;
|
||||
|
||||
/* add in lines at the bottom */
|
||||
for(it = newchat.begin(); it != newchat.end(); it++)
|
||||
for(it = newchat.begin(); it != newchat.end(); ++it)
|
||||
{
|
||||
/* are they private? */
|
||||
if (it->chatflags & RS_CHAT_PRIVATE)
|
||||
@ -623,7 +623,7 @@ void FriendsDialog::insertSendList()
|
||||
//QTreeWidget *sendWidget = ui.msgSendList;
|
||||
QList<QTreeWidgetItem *> items;
|
||||
|
||||
for(it = peers.begin(); it != peers.end(); it++)
|
||||
for(it = peers.begin(); it != peers.end(); ++it)
|
||||
{
|
||||
|
||||
RsPeerDetails details;
|
||||
|
@ -183,7 +183,7 @@ void GenCertDialog::init()
|
||||
bool foundGPGKeys = false;
|
||||
if (!mOnlyGenerateIdentity) {
|
||||
if (RsAccounts::GetPGPLogins(pgpIds)) {
|
||||
for(it = pgpIds.begin(); it != pgpIds.end(); it++)
|
||||
for(it = pgpIds.begin(); it != pgpIds.end(); ++it)
|
||||
{
|
||||
QVariant userData(QString::fromStdString( (*it).toStdString() ));
|
||||
std::string name, email;
|
||||
|
@ -398,7 +398,7 @@ void IdDialog::insertIdList(uint32_t token)
|
||||
QTreeWidgetItemIterator itemIterator(ui.treeWidget_IdList);
|
||||
QTreeWidgetItem *item = NULL;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
for (vit = datavector.begin(); vit != datavector.end(); ++vit)
|
||||
{
|
||||
@ -815,7 +815,7 @@ void IdDialog::insertRepList(uint32_t token)
|
||||
return;
|
||||
}
|
||||
|
||||
for(vit = opinions.begin(); vit != opinions.end(); vit++)
|
||||
for(vit = opinions.begin(); vit != opinions.end(); ++vit)
|
||||
{
|
||||
RsGxsIdOpinion &op = (*vit);
|
||||
GxsIdTreeWidgetItem *item = new GxsIdTreeWidgetItem();
|
||||
|
@ -314,7 +314,7 @@ void IdEditDialog::rmTag(int idx)
|
||||
{
|
||||
std::list<std::string>::iterator it;
|
||||
int i = 0;
|
||||
for(it = mEditGroup.mRecognTags.begin(); it != mEditGroup.mRecognTags.end() && (idx < i); it++, i++) ;
|
||||
for(it = mEditGroup.mRecognTags.begin(); it != mEditGroup.mRecognTags.end() && (idx < i); ++it, ++i) ;
|
||||
|
||||
if (it != mEditGroup.mRecognTags.end())
|
||||
{
|
||||
@ -384,7 +384,7 @@ void IdEditDialog::loadRecognTags()
|
||||
|
||||
int i = 0;
|
||||
std::list<std::string>::const_iterator it;
|
||||
for(it = mEditGroup.mRecognTags.begin(); it != mEditGroup.mRecognTags.end(); it++, i++)
|
||||
for(it = mEditGroup.mRecognTags.begin(); it != mEditGroup.mRecognTags.end(); ++it, ++i)
|
||||
{
|
||||
QString recognTag;
|
||||
tagDetails(mEditGroup.mMeta.mAuthorId, mEditGroup.mMeta.mGroupName, *it, recognTag);
|
||||
|
@ -701,7 +701,7 @@ void MainWindow::updateTrayCombine()
|
||||
QList<QAction*> actions = notifyMenu->actions();
|
||||
int count = 0;
|
||||
QList<QAction*>::iterator actionIt;
|
||||
for (actionIt = actions.begin(); actionIt != actions.end(); actionIt++) {
|
||||
for (actionIt = actions.begin(); actionIt != actions.end(); ++actionIt) {
|
||||
if ((*actionIt)->isVisible()) {
|
||||
visible = true;
|
||||
|
||||
@ -1264,7 +1264,7 @@ void MainWindow::loadOwnStatus()
|
||||
StatusInfo statusInfo;
|
||||
if (rsStatus->getOwnStatus(statusInfo)) {
|
||||
/* send status to all added objects */
|
||||
for (std::set <QObject*>::iterator it = m_apStatusObjects.begin(); it != m_apStatusObjects.end(); it++) {
|
||||
for (std::set <QObject*>::iterator it = m_apStatusObjects.begin(); it != m_apStatusObjects.end(); ++it) {
|
||||
setStatusObject(*it, statusInfo.status);
|
||||
}
|
||||
}
|
||||
@ -1374,7 +1374,7 @@ void MainWindow::setStatus(QObject *pObject, int nStatus)
|
||||
rsStatus->sendStatus(RsPeerId(), nStatus);
|
||||
|
||||
/* set status in all status objects, but the calling one */
|
||||
for (std::set <QObject*>::iterator it = m_apStatusObjects.begin(); it != m_apStatusObjects.end(); it++) {
|
||||
for (std::set <QObject*>::iterator it = m_apStatusObjects.begin(); it != m_apStatusObjects.end(); ++it) {
|
||||
if (*it != pObject) {
|
||||
setStatusObject(*it, nStatus);
|
||||
}
|
||||
@ -1408,7 +1408,7 @@ void MainWindow::settingsChanged()
|
||||
ui->toolBarPage->setVisible(Settings->getPageButtonLoc());
|
||||
ui->toolBarAction->setVisible(Settings->getActionButtonLoc());
|
||||
ui->listWidget->setVisible(!Settings->getPageButtonLoc() || !Settings->getActionButtonLoc());
|
||||
for(int i = 0; i < ui->listWidget->count(); i++) {
|
||||
for(int i = 0; i < ui->listWidget->count(); ++i) {
|
||||
if (ui->listWidget->item(i)->data(Qt::UserRole).toString() == "") {
|
||||
ui->listWidget->item(i)->setHidden(Settings->getPageButtonLoc());
|
||||
} else {
|
||||
|
@ -95,7 +95,7 @@ MessagesDialog::LockUpdate::LockUpdate (MessagesDialog *pDialog, bool bUpdate)
|
||||
m_pDialog = pDialog;
|
||||
m_bUpdate = bUpdate;
|
||||
|
||||
m_pDialog->lockUpdate++;
|
||||
++m_pDialog->lockUpdate;
|
||||
}
|
||||
|
||||
MessagesDialog::LockUpdate::~LockUpdate ()
|
||||
@ -446,7 +446,7 @@ void MessagesDialog::fillQuickView()
|
||||
itemToSelect = item;
|
||||
}
|
||||
|
||||
for (tag = tags.types.begin(); tag != tags.types.end(); tag++) {
|
||||
for (tag = tags.types.begin(); tag != tags.types.end(); ++tag) {
|
||||
text = TagDefs::name(tag->first, tag->second.first);
|
||||
|
||||
item = new QListWidgetItem (text, ui.quickViewWidget);
|
||||
@ -574,12 +574,12 @@ void MessagesDialog::messageTreeWidgetCustomPopupMenu(QPoint /*point*/)
|
||||
contextMnu.addSeparator();
|
||||
|
||||
action = contextMnu.addAction(QIcon(":/images/message-mail-read.png"), tr("Mark as read"), this, SLOT(markAsRead()));
|
||||
if (itemsUnread.size() == 0) {
|
||||
if (itemsUnread.isEmpty()) {
|
||||
action->setDisabled(true);
|
||||
}
|
||||
|
||||
action = contextMnu.addAction(QIcon(":/images/message-mail.png"), tr("Mark as unread"), this, SLOT(markAsUnread()));
|
||||
if (itemsRead.size() == 0) {
|
||||
if (itemsRead.isEmpty()) {
|
||||
action->setDisabled(true);
|
||||
}
|
||||
|
||||
@ -822,7 +822,7 @@ static void InitIconAndFont(QTreeWidgetItem *item)
|
||||
}
|
||||
|
||||
// set font
|
||||
for (int i = 0; i < COLUMN_COUNT; i++) {
|
||||
for (int i = 0; i < COLUMN_COUNT; ++i) {
|
||||
QFont qf = item->font(i);
|
||||
qf.setBold(isNew);
|
||||
item->setFont(i, qf);
|
||||
@ -960,7 +960,7 @@ void MessagesDialog::insertMessages()
|
||||
|
||||
/* search messages */
|
||||
std::list<MsgInfoSummary> msgToShow;
|
||||
for(it = msgList.begin(); it != msgList.end(); it++) {
|
||||
for(it = msgList.begin(); it != msgList.end(); ++it) {
|
||||
if (listMode == LIST_BOX) {
|
||||
if (isTrash) {
|
||||
if ((it->msgflags & RS_MSG_TRASH) == 0) {
|
||||
@ -1000,7 +1000,7 @@ void MessagesDialog::insertMessages()
|
||||
while ((treeItem = *itemIterator) != NULL) {
|
||||
++itemIterator;
|
||||
std::string msgIdFromRow = treeItem->data(COLUMN_DATA, ROLE_MSGID).toString().toStdString();
|
||||
for(it = msgToShow.begin(); it != msgToShow.end(); it++) {
|
||||
for(it = msgToShow.begin(); it != msgToShow.end(); ++it) {
|
||||
if (it->msgId == msgIdFromRow) {
|
||||
break;
|
||||
}
|
||||
@ -1011,7 +1011,7 @@ void MessagesDialog::insertMessages()
|
||||
}
|
||||
}
|
||||
|
||||
for(it = msgToShow.begin(); it != msgToShow.end(); it++)
|
||||
for(it = msgToShow.begin(); it != msgToShow.end(); ++it)
|
||||
{
|
||||
/* check the message flags, to decide which
|
||||
* group it should go in...
|
||||
@ -1116,7 +1116,7 @@ void MessagesDialog::insertMessages()
|
||||
|
||||
text.clear();
|
||||
|
||||
for(std::list<RsPeerId>::const_iterator pit = msgInfo.rspeerid_msgto.begin(); pit != msgInfo.rspeerid_msgto.end(); pit++)
|
||||
for(std::list<RsPeerId>::const_iterator pit = msgInfo.rspeerid_msgto.begin(); pit != msgInfo.rspeerid_msgto.end(); ++pit)
|
||||
{
|
||||
if (!text.isEmpty())
|
||||
text += ", ";
|
||||
@ -1127,7 +1127,7 @@ void MessagesDialog::insertMessages()
|
||||
else
|
||||
text += QString::fromUtf8(peerName.c_str());
|
||||
}
|
||||
for(std::list<RsGxsId>::const_iterator pit = msgInfo.rsgxsid_msgto.begin(); pit != msgInfo.rsgxsid_msgto.end(); pit++)
|
||||
for(std::list<RsGxsId>::const_iterator pit = msgInfo.rsgxsid_msgto.begin(); pit != msgInfo.rsgxsid_msgto.end(); ++pit)
|
||||
{
|
||||
if (!text.isEmpty())
|
||||
text += ", ";
|
||||
@ -1174,7 +1174,7 @@ void MessagesDialog::insertMessages()
|
||||
|
||||
// build tag names
|
||||
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator Tag;
|
||||
for (std::list<uint32_t>::iterator tagId = tagInfo.tagIds.begin(); tagId != tagInfo.tagIds.end(); tagId++) {
|
||||
for (std::list<uint32_t>::iterator tagId = tagInfo.tagIds.begin(); tagId != tagInfo.tagIds.end(); ++tagId) {
|
||||
if (text.isEmpty() == false) {
|
||||
text += ",";
|
||||
}
|
||||
@ -1204,7 +1204,7 @@ void MessagesDialog::insertMessages()
|
||||
color = ui.messageTreeWidget->palette().color(QPalette::Text);
|
||||
}
|
||||
QBrush brush = QBrush(color);
|
||||
for (int i = 0; i < COLUMN_COUNT; i++) {
|
||||
for (int i = 0; i < COLUMN_COUNT; ++i) {
|
||||
item->setForeground(i, brush);
|
||||
}
|
||||
|
||||
@ -1658,45 +1658,45 @@ void MessagesDialog::updateMessageSummaryList()
|
||||
QMap<int, int> tagCount;
|
||||
|
||||
/* calculating the new messages */
|
||||
for (it = msgList.begin(); it != msgList.end(); it++) {
|
||||
for (it = msgList.begin(); it != msgList.end(); ++it) {
|
||||
/* calcluate tag count */
|
||||
MsgTagInfo tagInfo;
|
||||
rsMsgs->getMessageTag(it->msgId, tagInfo);
|
||||
for (std::list<uint32_t>::iterator tagId = tagInfo.tagIds.begin(); tagId != tagInfo.tagIds.end(); tagId++) {
|
||||
for (std::list<uint32_t>::iterator tagId = tagInfo.tagIds.begin(); tagId != tagInfo.tagIds.end(); ++tagId) {
|
||||
int nCount = tagCount [*tagId];
|
||||
nCount++;
|
||||
++nCount;
|
||||
tagCount [*tagId] = nCount;
|
||||
}
|
||||
|
||||
if (it->msgflags & RS_MSG_STAR) {
|
||||
starredCount++;
|
||||
++starredCount;
|
||||
}
|
||||
|
||||
if (it->msgflags & RS_MSG_SYSTEM) {
|
||||
systemCount++;
|
||||
++systemCount;
|
||||
}
|
||||
|
||||
/* calculate box */
|
||||
if (it->msgflags & RS_MSG_TRASH) {
|
||||
trashboxCount++;
|
||||
++trashboxCount;
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (it->msgflags & RS_MSG_BOXMASK) {
|
||||
case RS_MSG_INBOX:
|
||||
inboxCount++;
|
||||
++inboxCount;
|
||||
if (it->msgflags & (RS_MSG_NEW | RS_MSG_UNREAD_BY_USER)) {
|
||||
newInboxCount++;
|
||||
++newInboxCount;
|
||||
}
|
||||
break;
|
||||
case RS_MSG_OUTBOX:
|
||||
newOutboxCount++;
|
||||
++newOutboxCount;
|
||||
break;
|
||||
case RS_MSG_DRAFTBOX:
|
||||
newDraftCount++;
|
||||
++newDraftCount;
|
||||
break;
|
||||
case RS_MSG_SENTBOX:
|
||||
newSentboxCount++;
|
||||
++newSentboxCount;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1810,7 +1810,7 @@ void MessagesDialog::updateMessageSummaryList()
|
||||
|
||||
/* set tag counts */
|
||||
int rowCount = ui.quickViewWidget->count();
|
||||
for (int row = 0; row < rowCount; row++) {
|
||||
for (int row = 0; row < rowCount; ++row) {
|
||||
QListWidgetItem *item = ui.quickViewWidget->item(row);
|
||||
switch (item->data(ROLE_QUICKVIEW_TYPE).toInt()) {
|
||||
case QUICKVIEW_TYPE_TAG:
|
||||
@ -1911,7 +1911,7 @@ void MessagesDialog::emptyTrash()
|
||||
rsMsgs->getMessageSummaries(msgList);
|
||||
|
||||
std::list<MsgInfoSummary>::const_iterator it;
|
||||
for (it = msgList.begin(); it != msgList.end(); it++) {
|
||||
for (it = msgList.begin(); it != msgList.end(); ++it) {
|
||||
if (it->msgflags & RS_MSG_TRASH) {
|
||||
rsMsgs->MessageDelete(it->msgId);
|
||||
}
|
||||
@ -1943,7 +1943,7 @@ void MessagesDialog::closeTab(const std::string &msgId)
|
||||
{
|
||||
QList<MessageWidget*> msgWidgets;
|
||||
|
||||
for (int tab = 1; tab < ui.tabWidget->count(); tab++) {
|
||||
for (int tab = 1; tab < ui.tabWidget->count(); ++tab) {
|
||||
MessageWidget *msgWidget = dynamic_cast<MessageWidget*>(ui.tabWidget->widget(tab));
|
||||
if (msgWidget && msgWidget->msgId() == msgId) {
|
||||
msgWidgets.append(msgWidget);
|
||||
|
@ -110,7 +110,7 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WindowFlags flags)
|
||||
connect(NotifyQt::getInstance(), SIGNAL(peerStatusChanged(QString,int)), this, SLOT(updateOwnStatus(QString,int)));
|
||||
|
||||
if (expandedPeers != NULL) {
|
||||
for (std::set<std::string>::iterator peerIt = expandedPeers->begin(); peerIt != expandedPeers->end(); peerIt++) {
|
||||
for (std::set<std::string>::iterator peerIt = expandedPeers->begin(); peerIt != expandedPeers->end(); ++peerIt) {
|
||||
ui.friendList->addPeerToExpand(*peerIt);
|
||||
}
|
||||
delete expandedPeers;
|
||||
@ -118,7 +118,7 @@ MessengerWindow::MessengerWindow(QWidget* parent, Qt::WindowFlags flags)
|
||||
}
|
||||
|
||||
if (expandedGroups != NULL) {
|
||||
for (std::set<std::string>::iterator groupIt = expandedGroups->begin(); groupIt != expandedGroups->end(); groupIt++) {
|
||||
for (std::set<std::string>::iterator groupIt = expandedGroups->begin(); groupIt != expandedGroups->end(); ++groupIt) {
|
||||
ui.friendList->addGroupToExpand(*groupIt);
|
||||
}
|
||||
delete expandedGroups;
|
||||
|
@ -414,12 +414,12 @@ void NetworkDialog::insertConnect()
|
||||
if ( (!rsPeers->getGPGDetails(gpg_widget_id, detail)) || (ui.onlyTrustedKeys->isChecked() && (detail.validLvl < RS_TRUST_LVL_MARGINAL && !detail.accept_connection)))
|
||||
delete (connectWidget->takeTopLevelItem(index));
|
||||
else
|
||||
index++;
|
||||
++index;
|
||||
}
|
||||
//QList<QTreeWidgetItem *> validItems;
|
||||
//QList<QTreeWidgetItem *> unvalidItems;
|
||||
|
||||
for(it = neighs.begin(); it != neighs.end(); it++)
|
||||
for(it = neighs.begin(); it != neighs.end(); ++it)
|
||||
{
|
||||
#ifdef NET_DEBUG
|
||||
std::cerr << "NetworkDialog::insertConnect() inserting gpg key : " << *it << std::endl;
|
||||
@ -537,7 +537,7 @@ void NetworkDialog::insertConnect()
|
||||
|
||||
// Color each Background column in the Network Tab except the first one => 1-9
|
||||
// whith the determinated color
|
||||
for(int i = 0; i <COLUMN_COUNT; i++)
|
||||
for(int i = 0; i <COLUMN_COUNT; ++i)
|
||||
item -> setBackground(i,QBrush(backgrndcolor));
|
||||
|
||||
if( (detail.accept_connection || detail.validLvl >= RS_TRUST_LVL_MARGINAL) || !ui.onlyTrustedKeys->isChecked())
|
||||
@ -780,7 +780,7 @@ void NetworkDialog::filterItems(const QString &text)
|
||||
int filterColumn = ui.filterLineEdit->currentFilter();
|
||||
|
||||
int count = ui.connectTreeWidget->topLevelItemCount ();
|
||||
for (int index = 0; index < count; index++) {
|
||||
for (int index = 0; index < count; ++index) {
|
||||
filterItem(ui.connectTreeWidget->topLevelItem(index), text, filterColumn);
|
||||
}
|
||||
}
|
||||
@ -797,9 +797,9 @@ bool NetworkDialog::filterItem(QTreeWidgetItem *item, const QString &text, int f
|
||||
|
||||
int visibleChildCount = 0;
|
||||
int count = item->childCount();
|
||||
for (int index = 0; index < count; index++) {
|
||||
for (int index = 0; index < count; ++index) {
|
||||
if (filterItem(item->child(index), text, filterColumn)) {
|
||||
visibleChildCount++;
|
||||
++visibleChildCount;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -210,12 +210,12 @@ void NetworkView::updateDisplay()
|
||||
std::cerr << "NetworkView::insertSignatures()" << std::endl;
|
||||
#endif
|
||||
|
||||
for(std::map<RsPgpId,GraphWidget::NodeId>::const_iterator it(_node_ids.begin()); it != _node_ids.end(); it++)
|
||||
for(std::map<RsPgpId,GraphWidget::NodeId>::const_iterator it(_node_ids.begin()); it != _node_ids.end(); ++it)
|
||||
{
|
||||
std::list<RsPgpId> friendList ;
|
||||
|
||||
if(rsDisc->getDiscPgpFriends(it->first,friendList))
|
||||
for(std::list<RsPgpId>::const_iterator sit(friendList.begin()); sit != friendList.end(); sit++)
|
||||
for(std::list<RsPgpId>::const_iterator sit(friendList.begin()); sit != friendList.end(); ++sit)
|
||||
{
|
||||
#ifdef DEBUG_NETWORKVIEW
|
||||
std::cerr << "NetworkView: Adding Edge: ";
|
||||
|
@ -164,7 +164,7 @@ void PeopleDialog::reloadAll()
|
||||
}//if(rsPeers->getGPGDetails(*it, details))
|
||||
}//for(it = friend_pgpIds.begin(); it != friend_pgpIds.end(); ++it)
|
||||
|
||||
for(it = all_pgpIds.begin(); it != all_pgpIds.end(); it++) {
|
||||
for(it = all_pgpIds.begin(); it != all_pgpIds.end(); ++it) {
|
||||
if(friend_set.end() != friend_set.find(*it)) {
|
||||
// already added as a friend.
|
||||
continue;
|
||||
@ -187,7 +187,7 @@ void PeopleDialog::reloadAll()
|
||||
idWidget->updateData(details) ;
|
||||
}//else ((itFound=_pgp_identity_widgets.find(gdItem.mPgpId)) == _pgp_identity_widgets.end())
|
||||
}//if(rsPeers->getGPGDetails(*it, details))
|
||||
}//for(it = all_pgpIds.begin(); it != all_pgpIds.end(); it++)
|
||||
}//for(it = all_pgpIds.begin(); it != all_pgpIds.end(); ++it)
|
||||
}
|
||||
|
||||
void PeopleDialog::insertIdList(uint32_t token)
|
||||
@ -262,7 +262,7 @@ void PeopleDialog::insertCircles(uint32_t token)
|
||||
return;
|
||||
}//if (!rsGxsCircles->getGroupSummary(token,gSummaryList))
|
||||
|
||||
for(gsIt = gSummaryList.begin(); gsIt != gSummaryList.end(); gsIt++) {
|
||||
for(gsIt = gSummaryList.begin(); gsIt != gSummaryList.end(); ++gsIt) {
|
||||
RsGroupMetaData gsItem = (*gsIt);
|
||||
|
||||
RsGxsCircleDetails details ;
|
||||
@ -336,7 +336,7 @@ void PeopleDialog::insertCircles(uint32_t token)
|
||||
//pictureFlowWidgetExternal->setSlide(index, pixmap);
|
||||
}//if((item=_circles_items.find(gsItem.mGroupId)) == _circles_items.end())
|
||||
}//else (!details.mIsExternal)
|
||||
}//for(gsIt = gSummaryList.begin(); gsIt != gSummaryList.end(); gsIt++)
|
||||
}//for(gsIt = gSummaryList.begin(); gsIt != gSummaryList.end(); ++gsIt)
|
||||
}
|
||||
|
||||
void PeopleDialog::requestIdList()
|
||||
|
@ -170,12 +170,12 @@ void PhotoDialog::loadComment(uint32_t token)
|
||||
|
||||
PhotoRelatedCommentResult::iterator mit = results.begin();
|
||||
|
||||
for(; mit != results.end(); mit++)
|
||||
for(; mit != results.end(); ++mit)
|
||||
{
|
||||
const std::vector<RsPhotoComment>& commentV = mit->second;
|
||||
std::vector<RsPhotoComment>::const_iterator vit = commentV.begin();
|
||||
|
||||
for(; vit != commentV.end(); vit++)
|
||||
for(; vit != commentV.end(); ++vit)
|
||||
{
|
||||
addComment(*vit);
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ int PhotoDrop::getPhotoCount()
|
||||
const QObjectList &items = children();
|
||||
QObjectList::const_iterator qit;
|
||||
int count = 0;
|
||||
for(qit = items.begin(); qit != items.end(); qit++)
|
||||
for(qit = items.begin(); qit != items.end(); ++qit)
|
||||
{
|
||||
PhotoItem *item = dynamic_cast<PhotoItem *>(*qit);
|
||||
if (item)
|
||||
@ -100,7 +100,7 @@ int PhotoDrop::getPhotoCount()
|
||||
std::cerr << "PhotoDrop::getPhotoCount() item: " << item;
|
||||
std::cerr << std::endl;
|
||||
|
||||
count++;
|
||||
++count;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -124,7 +124,7 @@ PhotoItem *PhotoDrop::getPhotoIdx(int idx)
|
||||
QObjectList::const_iterator qit;
|
||||
|
||||
int count = 0;
|
||||
for(qit = items.begin(); qit != items.end(); qit++)
|
||||
for(qit = items.begin(); qit != items.end(); ++qit)
|
||||
{
|
||||
PhotoItem *item = dynamic_cast<PhotoItem *>(*qit);
|
||||
if (item)
|
||||
@ -136,7 +136,7 @@ PhotoItem *PhotoDrop::getPhotoIdx(int idx)
|
||||
return item;
|
||||
}
|
||||
|
||||
count++;
|
||||
++count;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -175,7 +175,7 @@ void PhotoDrop::reorderPhotos()
|
||||
|
||||
int count = glayout->count();
|
||||
int i = 0;
|
||||
for(i = 0; i < count; i++)
|
||||
for(i = 0; i < count; ++i)
|
||||
{
|
||||
QLayoutItem *litem = glayout->itemAt(i);
|
||||
if (!litem)
|
||||
@ -246,12 +246,12 @@ void PhotoDrop::reorderPhotos()
|
||||
std::cerr << std::endl;
|
||||
|
||||
|
||||
for(pit = photoItems.begin(); pit != photoItems.end(); pit++)
|
||||
for(pit = photoItems.begin(); pit != photoItems.end(); ++pit)
|
||||
{
|
||||
glayout->removeWidget(pit->second);
|
||||
}
|
||||
|
||||
for(pit = photoItems.begin(), i = 0; pit != photoItems.end(); pit++, i++)
|
||||
for(pit = photoItems.begin(), i = 0; pit != photoItems.end(); ++pit, ++i)
|
||||
{
|
||||
int row = i / mColumns;
|
||||
int column = i % mColumns;
|
||||
@ -400,7 +400,7 @@ void PhotoDrop::moveRight()
|
||||
|
||||
if (swapColumn == mColumns)
|
||||
{
|
||||
swapRow++;
|
||||
++swapRow;
|
||||
swapColumn = 0;
|
||||
}
|
||||
|
||||
@ -504,7 +504,7 @@ void PhotoDrop::clearPhotos()
|
||||
std::list<PhotoItem *> photoItems;
|
||||
std::list<PhotoItem *>::iterator pit;
|
||||
|
||||
for(qit = items.begin(); qit != items.end(); qit++)
|
||||
for(qit = items.begin(); qit != items.end(); ++qit)
|
||||
{
|
||||
PhotoItem *item = dynamic_cast<PhotoItem *>(*qit);
|
||||
if (item)
|
||||
@ -529,7 +529,7 @@ void PhotoDrop::clearPhotos()
|
||||
return;
|
||||
}
|
||||
|
||||
for(pit = photoItems.begin(); pit != photoItems.end(); pit++)
|
||||
for(pit = photoItems.begin(); pit != photoItems.end(); ++pit)
|
||||
{
|
||||
PhotoItem *item = *pit;
|
||||
glayout->removeWidget(item);
|
||||
|
@ -483,7 +483,7 @@ void PhotoShare::loadAlbumList(const uint32_t &token)
|
||||
requestAlbumData(albumIds);
|
||||
|
||||
std::list<RsGxsGroupId>::iterator it;
|
||||
for(it = albumIds.begin(); it != albumIds.end(); it++)
|
||||
for(it = albumIds.begin(); it != albumIds.end(); ++it)
|
||||
{
|
||||
requestPhotoList(*it);
|
||||
}
|
||||
@ -516,7 +516,7 @@ bool PhotoShare::loadAlbumData(const uint32_t &token)
|
||||
|
||||
std::vector<RsPhotoAlbum>::iterator vit = albums.begin();
|
||||
|
||||
for(; vit != albums.end(); vit++)
|
||||
for(; vit != albums.end(); ++vit)
|
||||
{
|
||||
RsPhotoAlbum& album = *vit;
|
||||
|
||||
@ -623,12 +623,12 @@ void PhotoShare::loadPhotoData(const uint32_t &token)
|
||||
PhotoResult::iterator mit = res.begin();
|
||||
|
||||
|
||||
for(; mit != res.end(); mit++)
|
||||
for(; mit != res.end(); ++mit)
|
||||
{
|
||||
std::vector<RsPhotoPhoto>& photoV = mit->second;
|
||||
std::vector<RsPhotoPhoto>::iterator vit = photoV.begin();
|
||||
|
||||
for(; vit != photoV.end(); vit++)
|
||||
for(; vit != photoV.end(); ++vit)
|
||||
{
|
||||
RsPhotoPhoto& photo = *vit;
|
||||
addPhoto(photo);
|
||||
|
@ -55,7 +55,7 @@ PhotoSlideShow::~PhotoSlideShow()
|
||||
{
|
||||
std::map<RsGxsMessageId, RsPhotoPhoto *>::iterator mit = mPhotos.begin();
|
||||
|
||||
for(; mit != mPhotos.end(); mit++)
|
||||
for(; mit != mPhotos.end(); ++mit)
|
||||
{
|
||||
delete mit->second;
|
||||
}
|
||||
@ -93,7 +93,7 @@ void PhotoSlideShow::moveRight()
|
||||
return;
|
||||
}
|
||||
|
||||
mImageIdx++;
|
||||
++mImageIdx;
|
||||
if (mImageIdx >= mPhotos.size())
|
||||
{
|
||||
mImageIdx = 0;
|
||||
@ -132,7 +132,7 @@ void PhotoSlideShow::timerEvent()
|
||||
return;
|
||||
}
|
||||
|
||||
mImageIdx++;
|
||||
++mImageIdx;
|
||||
if (mImageIdx >= mPhotos.size())
|
||||
{
|
||||
mImageIdx = 0;
|
||||
@ -159,7 +159,7 @@ void PhotoSlideShow::loadImage()
|
||||
|
||||
//std::map<std::string, RsPhotoPhoto *>::iterator it;
|
||||
std::map<int, RsGxsMessageId>::iterator it;
|
||||
for(it = mPhotoOrder.begin(); it != mPhotoOrder.end(); it++, i++)
|
||||
for(it = mPhotoOrder.begin(); it != mPhotoOrder.end(); ++it, ++i)
|
||||
{
|
||||
if (i == mImageIdx)
|
||||
{
|
||||
@ -242,12 +242,12 @@ bool PhotoSlideShow::loadPhotoData(const uint32_t &token)
|
||||
PhotoResult::iterator mit = res.begin();
|
||||
|
||||
|
||||
for(; mit != res.end(); mit++)
|
||||
for(; mit != res.end(); ++mit)
|
||||
{
|
||||
std::vector<RsPhotoPhoto>& photoV = mit->second;
|
||||
std::vector<RsPhotoPhoto>::iterator vit = photoV.begin();
|
||||
int i = 0;
|
||||
for(; vit != photoV.end(); vit++)
|
||||
for(; vit != photoV.end(); ++vit)
|
||||
{
|
||||
RsPhotoPhoto& photo = *vit;
|
||||
RsPhotoPhoto *ptr = new RsPhotoPhoto;
|
||||
|
@ -460,7 +460,7 @@ void PostedListWidget::applyRanking()
|
||||
std::cerr << std::endl;
|
||||
item->hide();
|
||||
}
|
||||
counter++;
|
||||
++counter;
|
||||
}
|
||||
|
||||
std::cerr << "PostedListWidget::applyRanking() Loaded New Order";
|
||||
@ -489,7 +489,7 @@ void PostedListWidget::shallowClearPosts()
|
||||
|
||||
QLayout *alayout = ui->scrollAreaWidgetContents->layout();
|
||||
int count = alayout->count();
|
||||
for(int i = 0; i < count; i++)
|
||||
for(int i = 0; i < count; ++i)
|
||||
{
|
||||
QLayoutItem *litem = alayout->itemAt(i);
|
||||
if (!litem)
|
||||
@ -514,7 +514,7 @@ void PostedListWidget::shallowClearPosts()
|
||||
}
|
||||
}
|
||||
|
||||
for(pit = postedItems.begin(); pit != postedItems.end(); pit++)
|
||||
for(pit = postedItems.begin(); pit != postedItems.end(); ++pit)
|
||||
{
|
||||
PostedItem *item = *pit;
|
||||
alayout->removeWidget(item);
|
||||
@ -542,7 +542,7 @@ void PostedListWidget::insertPosts(const uint32_t &token, GxsMessageFramePostThr
|
||||
rsPosted->getPostData(token, posts);
|
||||
|
||||
std::vector<RsPostedPost>::iterator vit;
|
||||
for(vit = posts.begin(); vit != posts.end(); vit++)
|
||||
for(vit = posts.begin(); vit != posts.end(); ++vit)
|
||||
{
|
||||
RsPostedPost& p = *vit;
|
||||
loadPost(p);
|
||||
@ -557,7 +557,7 @@ void PostedListWidget::insertRelatedPosts(const uint32_t &token)
|
||||
rsPosted->getRelatedPosts(token, posts);
|
||||
|
||||
std::vector<RsPostedPost>::iterator vit;
|
||||
for(vit = posts.begin(); vit != posts.end(); vit++)
|
||||
for(vit = posts.begin(); vit != posts.end(); ++vit)
|
||||
{
|
||||
RsPostedPost& p = *vit;
|
||||
|
||||
@ -580,7 +580,7 @@ void PostedListWidget::insertRelatedPosts(const uint32_t &token)
|
||||
|
||||
time_t now = time(NULL);
|
||||
QMap<RsGxsMessageId, PostedItem*>::iterator pit;
|
||||
for(pit = mPosts.begin(); pit != mPosts.end(); pit++)
|
||||
for(pit = mPosts.begin(); pit != mPosts.end(); ++pit)
|
||||
{
|
||||
(*pit)->post().calculateScores(now);
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ void QuickStartWizard::loadShare()
|
||||
connect(this,SIGNAL(itemClicked(QTableWidgetItem*)),this,SLOT(updateFlags(QTableWidgetItem*))) ;
|
||||
|
||||
int row=0 ;
|
||||
for(it = dirs.begin(); it != dirs.end(); it++,++row)
|
||||
for(it = dirs.begin(); it != dirs.end(); ++it,++row)
|
||||
{
|
||||
listWidget->insertRow(row) ;
|
||||
listWidget->setItem(row,0,new QTableWidgetItem(QString::fromStdString((*it).filename)));
|
||||
@ -345,7 +345,7 @@ void QuickStartWizard::updateFlags(bool b)
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
int row=0 ;
|
||||
for(it = dirs.begin(); it != dirs.end(); it++,++row)
|
||||
for(it = dirs.begin(); it != dirs.end(); ++it,++row)
|
||||
{
|
||||
std::cerr << "Looking for row=" << row << ", file=" << (*it).filename << ", flags=" << (*it).shareflags << std::endl ;
|
||||
FileStorageFlags current_flags(0u) ;
|
||||
|
@ -578,7 +578,7 @@ QVariant RetroshareDirModel::data(const QModelIndex &index, int role) const
|
||||
// return;
|
||||
// } else if (details.type == DIR_TYPE_DIR && ret.isEmpty()) {
|
||||
// std::list<DirStub>::const_iterator it;
|
||||
// for (it = details.children.begin(); it != details.children.end(); it++) {
|
||||
// for (it = details.children.begin(); it != details.children.end(); ++it) {
|
||||
// void *ref = it->ref;
|
||||
// const DirDetails *childDetails = requestDirDetails(ref, RemoteMode);
|
||||
|
||||
@ -868,7 +868,7 @@ void RetroshareDirModel::postMods()
|
||||
|
||||
// QModelIndexList piList = persistentIndexList();
|
||||
// QModelIndexList empty;
|
||||
// for (int i = 0; i < piList.size(); i++) {
|
||||
// for (int i = 0; i < piList.size(); ++i) {
|
||||
// empty.append(QModelIndex());
|
||||
// }
|
||||
// changePersistentIndexList(piList, empty);
|
||||
@ -994,7 +994,7 @@ void RetroshareDirModel::downloadDirectory(const DirDetails & dirDetails, int pr
|
||||
|
||||
if (!dwlDir.mkpath(cleanPath)) return;
|
||||
|
||||
for (it = dirDetails.children.begin(); it != dirDetails.children.end(); it++)
|
||||
for (it = dirDetails.children.begin(); it != dirDetails.children.end(); ++it)
|
||||
{
|
||||
if (!it->ref) continue;
|
||||
|
||||
@ -1013,7 +1013,7 @@ void RetroshareDirModel::getDirDetailsFromSelect (const QModelIndexList &list, s
|
||||
|
||||
/* Fire off requests */
|
||||
QModelIndexList::const_iterator it;
|
||||
for(it = list.begin(); it != list.end(); it++)
|
||||
for(it = list.begin(); it != list.end(); ++it)
|
||||
{
|
||||
if(it->column()==1)
|
||||
{
|
||||
@ -1108,7 +1108,7 @@ void RetroshareDirModel::openSelected(const QModelIndexList &qmil)
|
||||
std::list<DirDetails>::iterator it;
|
||||
getFileInfoFromIndexList(qmil, files_info);
|
||||
|
||||
for (it = files_info.begin(); it != files_info.end(); it++)
|
||||
for (it = files_info.begin(); it != files_info.end(); ++it)
|
||||
{
|
||||
if ((*it).type & DIR_TYPE_PERSON) continue;
|
||||
|
||||
@ -1147,7 +1147,7 @@ void RetroshareDirModel::getFilePaths(const QModelIndexList &list, std::list<std
|
||||
}
|
||||
/* translate */
|
||||
QModelIndexList::const_iterator it;
|
||||
for(it = list.begin(); it != list.end(); it++)
|
||||
for(it = list.begin(); it != list.end(); ++it)
|
||||
{
|
||||
void *ref = it -> internalPointer();
|
||||
|
||||
@ -1202,7 +1202,7 @@ QMimeData * RetroshareDirModel::mimeData ( const QModelIndexList & indexes ) con
|
||||
std::map<RsFileHash, uint64_t> drags;
|
||||
std::map<RsFileHash, uint64_t>::iterator dit;
|
||||
|
||||
for(it = indexes.begin(); it != indexes.end(); it++)
|
||||
for(it = indexes.begin(); it != indexes.end(); ++it)
|
||||
{
|
||||
void *ref = it -> internalPointer();
|
||||
|
||||
@ -1341,7 +1341,7 @@ void FlatStyle_RDM::updateRefs()
|
||||
#ifdef RDM_DEBUG
|
||||
std::cerr << "FlatStyle_RDM::postMods(): addign ref " << ref << std::endl;
|
||||
#endif
|
||||
for(std::list<DirStub>::const_iterator it = details->children.begin(); it != details->children.end(); it++)
|
||||
for(std::list<DirStub>::const_iterator it = details->children.begin(); it != details->children.end(); ++it)
|
||||
_ref_stack.push_back(it->ref) ;
|
||||
}
|
||||
if(++nb_treated_refs > MAX_REFS_PER_SECOND) // we've done enough, let's give back hand to
|
||||
|
@ -920,7 +920,7 @@ bool RetroShareLink::checkHash(const QString& hash)
|
||||
|
||||
static void processList(const QStringList &list, const QString &textSingular, const QString &textPlural, QString &result)
|
||||
{
|
||||
if (list.size() == 0) {
|
||||
if (list.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (list.size() == 1) {
|
||||
@ -946,7 +946,7 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
||||
|
||||
/* filter dublicate links */
|
||||
QList<RetroShareLink> links;
|
||||
for (linkIt = linksIn.begin(); linkIt != linksIn.end(); linkIt++) {
|
||||
for (linkIt = linksIn.begin(); linkIt != linksIn.end(); ++linkIt) {
|
||||
if (links.contains(*linkIt)) {
|
||||
continue;
|
||||
}
|
||||
@ -959,7 +959,7 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
||||
QStringList fileAdd;
|
||||
QStringList personAdd;
|
||||
|
||||
for (linkIt = links.begin(); linkIt != links.end(); linkIt++) {
|
||||
for (linkIt = links.begin(); linkIt != links.end(); ++linkIt) {
|
||||
const RetroShareLink &link = *linkIt;
|
||||
|
||||
if (link.valid() == false) {
|
||||
@ -1060,19 +1060,19 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
||||
errorList << &fileExist << &personExist << &personFailed << &personNotFound << &forumUnknown << &forumMsgUnknown << &channelUnknown << &channelMsgUnknown << &messageReceipientNotAccepted << &messageReceipientUnknown;
|
||||
// not needed: forumFound, channelFound, messageStarted
|
||||
|
||||
for (linkIt = links.begin(); linkIt != links.end(); linkIt++) {
|
||||
for (linkIt = links.begin(); linkIt != links.end(); ++linkIt) {
|
||||
const RetroShareLink &link = *linkIt;
|
||||
|
||||
if (link.valid() == false) {
|
||||
std::cerr << " RetroShareLink::process invalid request" << std::endl;
|
||||
countInvalid++;
|
||||
++countInvalid;
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (link.type())
|
||||
{
|
||||
case TYPE_UNKNOWN:
|
||||
countUnknown++;
|
||||
++countUnknown;
|
||||
break;
|
||||
|
||||
case TYPE_CERTIFICATE:
|
||||
@ -1345,7 +1345,7 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
||||
|
||||
default:
|
||||
std::cerr << " RetroShareLink::process unknown type: " << link.type() << std::endl;
|
||||
countUnknown++;
|
||||
++countUnknown;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1459,7 +1459,7 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
||||
{
|
||||
QList<RetroShareLink> links;
|
||||
|
||||
for (QStringList::const_iterator it = urls.begin(); it != urls.end(); it++) {
|
||||
for (QStringList::const_iterator it = urls.begin(); it != urls.end(); ++it) {
|
||||
RetroShareLink link(*it);
|
||||
if (link.valid() && (type == RetroShareLink::TYPE_UNKNOWN || link.type() == type)) {
|
||||
links.append(link);
|
||||
@ -1562,7 +1562,7 @@ bool RSLinkClipboard::empty(RetroShareLink::enumType type /* = RetroShareLink::T
|
||||
return links.empty();
|
||||
}
|
||||
|
||||
for (QList<RetroShareLink>::iterator link = links.begin(); link != links.end(); link++) {
|
||||
for (QList<RetroShareLink>::iterator link = links.begin(); link != links.end(); ++link) {
|
||||
if (link->type() == type) {
|
||||
return false;
|
||||
}
|
||||
@ -1577,13 +1577,13 @@ bool RSLinkClipboard::empty(RetroShareLink::enumType type /* = RetroShareLink::T
|
||||
pasteLinks(links);
|
||||
|
||||
QList<RetroShareLink> linksToProcess;
|
||||
for (int i = 0; i < links.size(); i++) {
|
||||
for (int i = 0; i < links.size(); ++i) {
|
||||
if (links[i].valid() && (type == RetroShareLink::TYPE_UNKNOWN || links[i].type() == type)) {
|
||||
linksToProcess.append(links[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (linksToProcess.size() == 0) {
|
||||
if (linksToProcess.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -317,7 +317,7 @@ void SearchDialog::initialiseFileTypeMappings()
|
||||
void SearchDialog::searchResultWidgetCustomPopupMenu( QPoint /*point*/ )
|
||||
{
|
||||
// Block the popup if no results available
|
||||
if ((ui.searchResultWidget->selectedItems()).size() == 0) return ;
|
||||
if ((ui.searchResultWidget->selectedItems()).isEmpty()) return ;
|
||||
|
||||
bool add_CollActions = false ;
|
||||
|
||||
@ -595,7 +595,7 @@ void SearchDialog::downloadDirectory(const QTreeWidgetItem *item, const QString
|
||||
}
|
||||
|
||||
// recursive call for every child - file or folder
|
||||
for (int i = 0, cnt = item->childCount(); i < cnt; i++) {
|
||||
for (int i = 0, cnt = item->childCount(); i < cnt; ++i) {
|
||||
QTreeWidgetItem *child = item->child(i);
|
||||
downloadDirectory(child, path);
|
||||
}
|
||||
@ -620,7 +620,7 @@ void SearchDialog::recommendtofriends()
|
||||
void SearchDialog::searchSummaryWidgetCustomPopupMenu( QPoint /*point*/ )
|
||||
{
|
||||
// block the popup if no results available
|
||||
if ((ui.searchSummaryWidget->selectedItems()).size() == 0) return;
|
||||
if ((ui.searchSummaryWidget->selectedItems()).isEmpty()) return;
|
||||
|
||||
QMenu contextMnu(this);
|
||||
|
||||
@ -669,7 +669,7 @@ void SearchDialog::searchRemove()
|
||||
else
|
||||
{
|
||||
/* step to the next */
|
||||
i++;
|
||||
++i;
|
||||
}
|
||||
}
|
||||
int sii = ui.searchSummaryWidget->indexOfTopLevelItem(ci);
|
||||
@ -877,7 +877,7 @@ void SearchDialog::searchKeywords(const QString& keywords)
|
||||
/* which extensions do we use? */
|
||||
DirDetails dd;
|
||||
|
||||
for(std::list<DirDetails>::iterator resultsIter = initialResults.begin(); resultsIter != initialResults.end(); resultsIter ++)
|
||||
for(std::list<DirDetails>::iterator resultsIter = initialResults.begin(); resultsIter != initialResults.end(); ++resultsIter)
|
||||
{
|
||||
dd = *resultsIter;
|
||||
finalResults.push_back(dd);
|
||||
@ -893,7 +893,7 @@ void SearchDialog::searchKeywords(const QString& keywords)
|
||||
/* which extensions do we use? */
|
||||
DirDetails dd;
|
||||
|
||||
for(std::list<DirDetails>::iterator resultsIter = initialResults.begin(); resultsIter != initialResults.end(); resultsIter ++)
|
||||
for(std::list<DirDetails>::iterator resultsIter = initialResults.begin(); resultsIter != initialResults.end(); ++resultsIter)
|
||||
{
|
||||
dd = *resultsIter;
|
||||
finalResults.push_back(dd);
|
||||
@ -1010,7 +1010,7 @@ void SearchDialog::insertDirectory(const QString &txt, qulonglong searchId, cons
|
||||
int items = ui.searchSummaryWidget->topLevelItemCount();
|
||||
bool found = false ;
|
||||
|
||||
for(int i = 0; i < items; i++)
|
||||
for(int i = 0; i < items; ++i)
|
||||
{
|
||||
if(ui.searchSummaryWidget->topLevelItem(i)->text(SS_SEARCH_ID_COL) == sid_hexa)
|
||||
{
|
||||
@ -1041,7 +1041,7 @@ void SearchDialog::insertDirectory(const QString &txt, qulonglong searchId, cons
|
||||
}
|
||||
|
||||
/* go through all children directories/files for a recursive call */
|
||||
for (std::list<DirStub>::const_iterator it(dir.children.begin()); it != dir.children.end(); it ++) {
|
||||
for (std::list<DirStub>::const_iterator it(dir.children.begin()); it != dir.children.end(); ++it) {
|
||||
DirDetails details;
|
||||
rsFiles->RequestDirDetails(it->ref, details, FileSearchFlags(0u));
|
||||
insertDirectory(txt, searchId, details, child);
|
||||
@ -1077,7 +1077,7 @@ void SearchDialog::insertDirectory(const QString &txt, qulonglong searchId, cons
|
||||
int items = ui.searchSummaryWidget->topLevelItemCount();
|
||||
bool found = false ;
|
||||
|
||||
for(int i = 0; i < items; i++)
|
||||
for(int i = 0; i < items; ++i)
|
||||
{
|
||||
if(ui.searchSummaryWidget->topLevelItem(i)->text(SS_SEARCH_ID_COL) == sid_hexa)
|
||||
{
|
||||
@ -1124,7 +1124,7 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s
|
||||
// the user, so nothing has to be done here
|
||||
int summaryItemCount = ui.searchSummaryWidget->topLevelItemCount();
|
||||
int summaryItemIndex = -1 ;
|
||||
for (int i = 0; i < summaryItemCount; i++) {
|
||||
for (int i = 0; i < summaryItemCount; ++i) {
|
||||
if(ui.searchSummaryWidget->topLevelItem(i)->text(SS_SEARCH_ID_COL) == sid_hexa) {
|
||||
summaryItemIndex = i ;
|
||||
break ;
|
||||
@ -1214,7 +1214,7 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s
|
||||
}
|
||||
|
||||
QBrush brush(foreground);
|
||||
for (int i = 0; i < item->columnCount(); i++)
|
||||
for (int i = 0; i < item->columnCount(); ++i)
|
||||
{
|
||||
item->setForeground(i, brush);
|
||||
}
|
||||
@ -1282,7 +1282,7 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s
|
||||
|
||||
if (setForeground) {
|
||||
QBrush brush(foreground);
|
||||
for (int i = 0; i < item->columnCount(); i++)
|
||||
for (int i = 0; i < item->columnCount(); ++i)
|
||||
{
|
||||
item->setForeground(i, brush);
|
||||
}
|
||||
@ -1310,7 +1310,7 @@ void SearchDialog::resultsToTree(const QString& txt,qulonglong searchId, const s
|
||||
/* translate search results */
|
||||
|
||||
std::list<DirDetails>::const_iterator it;
|
||||
for(it = results.begin(); it != results.end(); it++)
|
||||
for(it = results.begin(); it != results.end(); ++it)
|
||||
if (it->type == DIR_TYPE_FILE) {
|
||||
FileDetail fd;
|
||||
fd.id = it->id;
|
||||
@ -1348,7 +1348,7 @@ void SearchDialog::selectSearchResults(int index)
|
||||
|
||||
/* show only matching searchIds in main window */
|
||||
int items = ui.searchResultWidget->topLevelItemCount();
|
||||
for(int i = 0; i < items; i++)
|
||||
for(int i = 0; i < items; ++i)
|
||||
{
|
||||
hideOrShowSearchResult(ui.searchResultWidget->topLevelItem(i), searchId, index);
|
||||
}
|
||||
@ -1465,7 +1465,7 @@ void SearchDialog::selectFileType(int index)
|
||||
|
||||
/* show only matching file types in main window */
|
||||
int items = ui.searchResultWidget->topLevelItemCount();
|
||||
for(int i = 0; i < items; i++)
|
||||
for(int i = 0; i < items; ++i)
|
||||
{
|
||||
hideOrShowSearchResult(ui.searchResultWidget->topLevelItem(i), searchId, index);
|
||||
}
|
||||
@ -1474,7 +1474,7 @@ void SearchDialog::selectFileType(int index)
|
||||
void SearchDialog::filterItems()
|
||||
{
|
||||
int count = ui.searchResultWidget->topLevelItemCount ();
|
||||
for (int index = 0; index < count; index++) {
|
||||
for (int index = 0; index < count; ++index) {
|
||||
hideOrShowSearchResult(ui.searchResultWidget->topLevelItem(index));
|
||||
}
|
||||
}
|
||||
@ -1491,9 +1491,9 @@ bool SearchDialog::filterItem(QTreeWidgetItem *item, const QString &text, int fi
|
||||
|
||||
int visibleChildCount = 0;
|
||||
int count = item->childCount();
|
||||
for (int index = 0; index < count; index++) {
|
||||
for (int index = 0; index < count; ++index) {
|
||||
if (filterItem(item->child(index), text, filterColumn)) {
|
||||
visibleChildCount++;
|
||||
++visibleChildCount;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ QMimeData * SearchTreeWidget::mimeData ( const QList<QTreeWidgetItem *> items )
|
||||
/* extract from each QTreeWidgetItem... all the member text */
|
||||
QList<QTreeWidgetItem *>::const_iterator it;
|
||||
QString text;
|
||||
for(it = items.begin(); it != items.end(); it++)
|
||||
for(it = items.begin(); it != items.end(); ++it)
|
||||
{
|
||||
QString line = QString("%1/%2/%3/").arg((*it)->text(SR_NAME_COL), (*it)->text(SR_HASH_COL), (*it)->text(SR_SIZE_COL));
|
||||
|
||||
|
@ -86,7 +86,7 @@ ShareDialog::ShareDialog(std::string filename, QWidget *parent)
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
std::list<SharedDirInfo>::const_iterator it;
|
||||
for (it = dirs.begin(); it != dirs.end(); it++) {
|
||||
for (it = dirs.begin(); it != dirs.end(); ++it) {
|
||||
if (it->filename == filename)
|
||||
{
|
||||
/* fill dialog */
|
||||
@ -156,7 +156,7 @@ void ShareDialog::addDirectory()
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
std::list<SharedDirInfo>::iterator it;
|
||||
for (it = dirs.begin(); it != dirs.end(); it++) {
|
||||
for (it = dirs.begin(); it != dirs.end(); ++it) {
|
||||
if (it->filename == sdi.filename) {
|
||||
found = true;
|
||||
|
||||
|
@ -141,7 +141,7 @@ void ShareManager::load()
|
||||
listWidget->setRowCount(dirs.size());
|
||||
|
||||
int row=0 ;
|
||||
for(it = dirs.begin(); it != dirs.end(); it++,++row)
|
||||
for(it = dirs.begin(); it != dirs.end(); ++it,++row)
|
||||
{
|
||||
listWidget->setItem(row, COLUMN_PATH, new QTableWidgetItem(QString::fromUtf8((*it).filename.c_str())));
|
||||
listWidget->setItem(row, COLUMN_VIRTUALNAME, new QTableWidgetItem(QString::fromUtf8((*it).virtualname.c_str())));
|
||||
@ -243,7 +243,7 @@ void ShareManager::updateGroups()
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
int row=0 ;
|
||||
for(it = dirs.begin(); it != dirs.end(); it++,++row)
|
||||
for(it = dirs.begin(); it != dirs.end(); ++it,++row)
|
||||
{
|
||||
QTableWidgetItem *item = ui.shareddirList->item(row, COLUMN_GROUPS);
|
||||
|
||||
@ -276,7 +276,7 @@ void ShareManager::editShareDirectory()
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
std::list<SharedDirInfo>::const_iterator it;
|
||||
for (it = dirs.begin(); it != dirs.end(); it++) {
|
||||
for (it = dirs.begin(); it != dirs.end(); ++it) {
|
||||
if (it->filename == filename) {
|
||||
/* file name found, show dialog */
|
||||
ShareDialog sharedlg (it->filename, this);
|
||||
@ -357,7 +357,7 @@ void ShareManager::dropEvent(QDropEvent *event)
|
||||
if (event->mimeData()->hasUrls()) {
|
||||
QList<QUrl> urls = event->mimeData()->urls();
|
||||
QList<QUrl>::iterator it;
|
||||
for (it = urls.begin(); it != urls.end(); it++) {
|
||||
for (it = urls.begin(); it != urls.end(); ++it) {
|
||||
QString localpath = it->toLocalFile();
|
||||
|
||||
if (localpath.isEmpty() == false) {
|
||||
|
@ -497,7 +497,7 @@ QModelIndexList SharedFilesDialog::getSelected()
|
||||
{
|
||||
QModelIndexList list = ui.dirTreeView->selectionModel()->selectedIndexes() ;
|
||||
QModelIndexList proxyList ;
|
||||
for (QModelIndexList::iterator index = list.begin(); index != list.end(); index++ ) {
|
||||
for (QModelIndexList::iterator index = list.begin(); index != list.end(); ++index ) {
|
||||
proxyList.append(proxyModel->mapToSource(*index)) ;
|
||||
}//for (QModelIndexList::iterator index
|
||||
|
||||
@ -521,7 +521,7 @@ void LocalSharedFilesDialog::editSharePermissions()
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
std::list<SharedDirInfo>::const_iterator it;
|
||||
for (it = dirs.begin(); it != dirs.end(); it++) {
|
||||
for (it = dirs.begin(); it != dirs.end(); ++it) {
|
||||
if (currentFile == currentFile) {
|
||||
/* file name found, show dialog */
|
||||
ShareDialog sharedlg (it->filename, this);
|
||||
@ -756,7 +756,7 @@ void LocalSharedFilesDialog::playselectedfiles()
|
||||
|
||||
std::list<std::string>::iterator it;
|
||||
QStringList fullpaths;
|
||||
for(it = paths.begin(); it != paths.end(); it++)
|
||||
for(it = paths.begin(); it != paths.end(); ++it)
|
||||
{
|
||||
std::string fullpath;
|
||||
rsFiles->ConvertSharedFilePath(*it, fullpath);
|
||||
@ -1023,7 +1023,7 @@ void SharedFilesDialog::FilterItems()
|
||||
QCoreApplication::processEvents() ;
|
||||
|
||||
int rowCount = ui.dirTreeView->model()->rowCount();
|
||||
for (int row = 0; row < rowCount; row++)
|
||||
for (int row = 0; row < rowCount; ++row)
|
||||
if(proxyModel == tree_proxyModel)
|
||||
tree_FilterItem(ui.dirTreeView->model()->index(row, COLUMN_NAME), text, 0);
|
||||
else
|
||||
@ -1063,9 +1063,9 @@ bool SharedFilesDialog::tree_FilterItem(const QModelIndex &index, const QString
|
||||
|
||||
int visibleChildCount = 0;
|
||||
int rowCount = ui.dirTreeView->model()->rowCount(index);
|
||||
for (int row = 0; row < rowCount; row++) {
|
||||
for (int row = 0; row < rowCount; ++row) {
|
||||
if (tree_FilterItem(ui.dirTreeView->model()->index(row, index.column(), index), text, level + 1)) {
|
||||
visibleChildCount++;
|
||||
++visibleChildCount;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ StartDialog::StartDialog(QWidget *parent)
|
||||
|
||||
if (RsAccounts::GetAccountIds(accountIds))
|
||||
{
|
||||
for(it = accountIds.begin(), i = 0; it != accountIds.end(); it++, i++)
|
||||
for(it = accountIds.begin(), i = 0; it != accountIds.end(); ++it, ++i)
|
||||
{
|
||||
const QVariant & userData = QVariant(QString::fromStdString((*it).toStdString()));
|
||||
RsPgpId gpgid ;
|
||||
|
@ -161,7 +161,7 @@ void PulseAddDialog::postPulse()
|
||||
/* now have path and album id */
|
||||
int photoCount = ui.scrollAreaWidgetContents->getPhotoCount();
|
||||
|
||||
for(int i = 0; i < photoCount; i++)
|
||||
for(int i = 0; i < photoCount; ++i)
|
||||
{
|
||||
RsPhotoPhoto photo;
|
||||
RsPhotoThumbnail thumbnail;
|
||||
|
@ -178,7 +178,7 @@ bool WireDialog::FilterNSortAlbums(const std::list<std::string> &albumIds, std::
|
||||
std::multimap<double, std::string>::iterator sit;
|
||||
std::list<std::string>::const_iterator it;
|
||||
|
||||
for(it = albumIds.begin(); it != albumIds.end(); it++)
|
||||
for(it = albumIds.begin(); it != albumIds.end(); ++it)
|
||||
{
|
||||
RsPhotoAlbum album;
|
||||
rsPhoto->getAlbum(*it, album);
|
||||
@ -192,7 +192,7 @@ bool WireDialog::FilterNSortAlbums(const std::list<std::string> &albumIds, std::
|
||||
}
|
||||
|
||||
int i;
|
||||
for (sit = sortedAlbums.begin(), i = 0; (sit != sortedAlbums.end()) && (i < count); sit++, i++)
|
||||
for (sit = sortedAlbums.begin(), i = 0; (sit != sortedAlbums.end()) && (i < count); ++sit, ++i)
|
||||
{
|
||||
filteredAlbumIds.push_back(sit->second);
|
||||
}
|
||||
@ -209,7 +209,7 @@ bool WireDialog::FilterNSortPhotos(const std::list<std::string> &photoIds, std::
|
||||
std::list<std::string>::const_iterator it;
|
||||
|
||||
int i = 0;
|
||||
for(it = photoIds.begin(); it != photoIds.end(); it++, i++)
|
||||
for(it = photoIds.begin(); it != photoIds.end(); ++it, ++i)
|
||||
{
|
||||
RsPhotoPhoto photo;
|
||||
rsPhoto->getPhoto(*it, photo);
|
||||
@ -221,7 +221,7 @@ bool WireDialog::FilterNSortPhotos(const std::list<std::string> &photoIds, std::
|
||||
}
|
||||
}
|
||||
|
||||
for (sit = sortedPhotos.begin(), i = 0; (sit != sortedPhotos.end()) && (i < count); sit++, i++)
|
||||
for (sit = sortedPhotos.begin(), i = 0; (sit != sortedPhotos.end()) && (i < count); ++sit, ++i)
|
||||
{
|
||||
filteredPhotoIds.push_back(sit->second);
|
||||
}
|
||||
@ -253,7 +253,7 @@ void WireDialog::insertAlbums()
|
||||
int count = MAX_ALBUMS;
|
||||
FilterNSortAlbums(albumIds, filteredAlbumIds, count);
|
||||
|
||||
for(it = filteredAlbumIds.begin(); it != filteredAlbumIds.end(); it++)
|
||||
for(it = filteredAlbumIds.begin(); it != filteredAlbumIds.end(); ++it)
|
||||
{
|
||||
addAlbum(*it);
|
||||
}
|
||||
@ -312,7 +312,7 @@ void WireDialog::clearAlbums()
|
||||
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents->layout();
|
||||
int count = alayout->count();
|
||||
for(int i = 0; i < count; i++)
|
||||
for(int i = 0; i < count; ++i)
|
||||
{
|
||||
QLayoutItem *litem = alayout->itemAt(i);
|
||||
if (!litem)
|
||||
@ -337,7 +337,7 @@ void WireDialog::clearAlbums()
|
||||
}
|
||||
}
|
||||
|
||||
for(pit = photoItems.begin(); pit != photoItems.end(); pit++)
|
||||
for(pit = photoItems.begin(); pit != photoItems.end(); ++pit)
|
||||
{
|
||||
PulseItem *item = *pit;
|
||||
alayout->removeWidget(item);
|
||||
@ -357,7 +357,7 @@ void WireDialog::clearPhotos()
|
||||
|
||||
QLayout *alayout = ui.scrollAreaWidgetContents_2->layout();
|
||||
int count = alayout->count();
|
||||
for(int i = 0; i < count; i++)
|
||||
for(int i = 0; i < count; ++i)
|
||||
{
|
||||
QLayoutItem *litem = alayout->itemAt(i);
|
||||
if (!litem)
|
||||
@ -382,7 +382,7 @@ void WireDialog::clearPhotos()
|
||||
}
|
||||
}
|
||||
|
||||
for(pit = photoItems.begin(); pit != photoItems.end(); pit++)
|
||||
for(pit = photoItems.begin(); pit != photoItems.end(); ++pit)
|
||||
{
|
||||
PulseItem *item = *pit;
|
||||
alayout->removeWidget(item);
|
||||
@ -409,7 +409,7 @@ void WireDialog::insertPhotosForAlbum(const std::list<std::string> &albumIds)
|
||||
std::list<std::string> filteredPhotoIds;
|
||||
std::list<std::string>::const_iterator it;
|
||||
|
||||
for(it = albumIds.begin(); it != albumIds.end(); it++)
|
||||
for(it = albumIds.begin(); it != albumIds.end(); ++it)
|
||||
{
|
||||
rsPhoto->getPhotoList(*it, photoIds);
|
||||
}
|
||||
@ -421,7 +421,7 @@ void WireDialog::insertPhotosForAlbum(const std::list<std::string> &albumIds)
|
||||
|
||||
FilterNSortPhotos(photoIds, filteredPhotoIds, MAX_PHOTOS);
|
||||
|
||||
for(it = filteredPhotoIds.begin(); it != filteredPhotoIds.end(); it++)
|
||||
for(it = filteredPhotoIds.begin(); it != filteredPhotoIds.end(); ++it)
|
||||
{
|
||||
addPhoto(*it);
|
||||
}
|
||||
|
@ -432,7 +432,7 @@ void WikiDialog::loadPages(const uint32_t &token)
|
||||
return;
|
||||
}
|
||||
|
||||
for(vit = snapshots.begin(); vit != snapshots.end(); vit++)
|
||||
for(vit = snapshots.begin(); vit != snapshots.end(); ++vit)
|
||||
{
|
||||
RsWikiSnapshot page = *vit;
|
||||
|
||||
@ -649,7 +649,7 @@ void WikiDialog::insertGroupsData(const std::list<RsGroupMetaData> &wikiList)
|
||||
QList<GroupItemInfo> otherList;
|
||||
std::multimap<uint32_t, GroupItemInfo> popMap;
|
||||
|
||||
for (it = wikiList.begin(); it != wikiList.end(); it++) {
|
||||
for (it = wikiList.begin(); it != wikiList.end(); ++it) {
|
||||
/* sort it into Publish (Own), Subscribed, Popular and Other */
|
||||
uint32_t flags = it->mSubscribeFlags;
|
||||
|
||||
@ -677,12 +677,12 @@ void WikiDialog::insertGroupsData(const std::list<RsGroupMetaData> &wikiList)
|
||||
uint32_t i = 0;
|
||||
uint32_t popLimit = 0;
|
||||
std::multimap<uint32_t, GroupItemInfo>::reverse_iterator rit;
|
||||
for(rit = popMap.rbegin(); ((rit != popMap.rend()) && (i < popCount)); rit++, i++) ;
|
||||
for(rit = popMap.rbegin(); ((rit != popMap.rend()) && (i < popCount)); ++rit, i++) ;
|
||||
if (rit != popMap.rend()) {
|
||||
popLimit = rit->first;
|
||||
}
|
||||
|
||||
for (rit = popMap.rbegin(); rit != popMap.rend(); rit++) {
|
||||
for (rit = popMap.rbegin(); rit != popMap.rend(); ++rit) {
|
||||
if (rit->second.popularity < (int) popLimit) {
|
||||
otherList.append(rit->second);
|
||||
} else {
|
||||
|
@ -185,7 +185,7 @@ void WikiEditDialog::updateHistoryStatus()
|
||||
|
||||
/* iterate through every History Item */
|
||||
int count = ui.treeWidget_History->topLevelItemCount();
|
||||
for(int i = 0; i < count; i++)
|
||||
for(int i = 0; i < count; ++i)
|
||||
{
|
||||
QTreeWidgetItem *item = ui.treeWidget_History->topLevelItem(i);
|
||||
bool isLatest = (i==count-1);
|
||||
@ -197,7 +197,7 @@ void WikiEditDialog::updateHistoryStatus()
|
||||
void WikiEditDialog::updateHistoryChildren(QTreeWidgetItem *item, bool isLatest)
|
||||
{
|
||||
int count = item->childCount();
|
||||
for(int i = 0; i < count; i++)
|
||||
for(int i = 0; i < count; ++i)
|
||||
{
|
||||
QTreeWidgetItem *child = item->child(i);
|
||||
|
||||
@ -701,7 +701,7 @@ void WikiEditDialog::loadBaseHistory(const uint32_t &token)
|
||||
return;
|
||||
}
|
||||
|
||||
for(vit = snapshots.begin(); vit != snapshots.end(); vit++)
|
||||
for(vit = snapshots.begin(); vit != snapshots.end(); ++vit)
|
||||
{
|
||||
RsWikiSnapshot &page = *vit;
|
||||
|
||||
@ -789,7 +789,7 @@ void WikiEditDialog::loadEditTreeData(const uint32_t &token)
|
||||
|
||||
// Grab the existing TopLevelItems, and insert into map.
|
||||
int itemCount = ui.treeWidget_History->topLevelItemCount();
|
||||
for (int nIndex = 0; nIndex < itemCount; nIndex++)
|
||||
for (int nIndex = 0; nIndex < itemCount; ++nIndex)
|
||||
{
|
||||
QTreeWidgetItem *item = ui.treeWidget_History->topLevelItem(nIndex);
|
||||
|
||||
@ -799,7 +799,7 @@ void WikiEditDialog::loadEditTreeData(const uint32_t &token)
|
||||
}
|
||||
|
||||
|
||||
for(vit = snapshots.begin(); vit != snapshots.end(); vit++)
|
||||
for(vit = snapshots.begin(); vit != snapshots.end(); ++vit)
|
||||
{
|
||||
RsWikiSnapshot &snapshot = *vit;
|
||||
|
||||
@ -863,7 +863,7 @@ void WikiEditDialog::loadEditTreeData(const uint32_t &token)
|
||||
items[snapshot.mMeta.mOrigMsgId] = modItem;
|
||||
}
|
||||
|
||||
for(uit = unparented.begin(); uit != unparented.end(); uit++)
|
||||
for(uit = unparented.begin(); uit != unparented.end(); ++uit)
|
||||
{
|
||||
RsGxsMessageId parentId ( (*uit)->data(WET_DATA_COLUMN, WET_ROLE_PARENTID).toString().toStdString());
|
||||
|
||||
|
@ -151,7 +151,7 @@ void ChatDialog::init(const RsPeerId &peerId, const QString &title)
|
||||
std::list<ChatDialog*> list;
|
||||
|
||||
std::map<RsPeerId, ChatDialog*>::iterator it;
|
||||
for (it = chatDialogs.begin(); it != chatDialogs.end(); it++) {
|
||||
for (it = chatDialogs.begin(); it != chatDialogs.end(); ++it) {
|
||||
if (it->second) {
|
||||
list.push_back(it->second);
|
||||
}
|
||||
@ -160,7 +160,7 @@ void ChatDialog::init(const RsPeerId &peerId, const QString &title)
|
||||
chatDialogs.clear();
|
||||
|
||||
std::list<ChatDialog*>::iterator it1;
|
||||
for (it1 = list.begin(); it1 != list.end(); it1++) {
|
||||
for (it1 = list.begin(); it1 != list.end(); ++it1) {
|
||||
delete (*it1);
|
||||
}
|
||||
}
|
||||
@ -176,7 +176,7 @@ void ChatDialog::init(const RsPeerId &peerId, const QString &title)
|
||||
uint chatflags = Settings->getChatFlags();
|
||||
|
||||
std::list<RsPeerId>::iterator id;
|
||||
for (id = ids.begin(); id != ids.end(); id++) {
|
||||
for (id = ids.begin(); id != ids.end(); ++id) {
|
||||
ChatDialog *cd = getChat(*id, chatflags);
|
||||
|
||||
if (cd) {
|
||||
@ -188,7 +188,7 @@ void ChatDialog::init(const RsPeerId &peerId, const QString &title)
|
||||
|
||||
/* now notify all open priavate chat windows */
|
||||
std::map<RsPeerId, ChatDialog *>::iterator it;
|
||||
for (it = chatDialogs.begin (); it != chatDialogs.end(); it++) {
|
||||
for (it = chatDialogs.begin (); it != chatDialogs.end(); ++it) {
|
||||
if (it->second) {
|
||||
it->second->onChatChanged(list, type);
|
||||
}
|
||||
@ -376,7 +376,7 @@ void ChatDialog::insertChatMsgs()
|
||||
}
|
||||
|
||||
std::list<ChatInfo>::iterator it;
|
||||
for(it = newchat.begin(); it != newchat.end(); it++)
|
||||
for(it = newchat.begin(); it != newchat.end(); ++it)
|
||||
{
|
||||
/* are they public? */
|
||||
if ((it->chatflags & RS_CHAT_PRIVATE) == 0) {
|
||||
|
@ -410,7 +410,7 @@ void ChatLobbyDialog::updateParticipantsList()
|
||||
void ChatLobbyDialog::changePartipationState()
|
||||
{
|
||||
QList<QTreeWidgetItem*> selectedItems = ui.participantsList->selectedItems();
|
||||
if (selectedItems.size() == 0) {
|
||||
if (selectedItems.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ bool ChatStyle::setStyleFromSettings(enumStyleType styleType)
|
||||
m_styleType = styleType;
|
||||
|
||||
// reset cache
|
||||
for (int i = 0; i < FORMATMSG_COUNT; i++) {
|
||||
for (int i = 0; i < FORMATMSG_COUNT; ++i) {
|
||||
m_style[i].clear();
|
||||
}
|
||||
|
||||
@ -489,7 +489,7 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle
|
||||
QFileInfoList dirList = dir.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name);
|
||||
|
||||
// iterate style directories and get info
|
||||
for (QFileInfoList::iterator it = dirList.begin(); it != dirList.end(); it++) {
|
||||
for (QFileInfoList::iterator it = dirList.begin(); it != dirList.end(); ++it) {
|
||||
QDir styleDir = QDir(it->absoluteFilePath());
|
||||
if (styleDir.cd(stylePath) == false) {
|
||||
// no user styles available
|
||||
@ -530,7 +530,7 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle
|
||||
QFileInfoList fileList = dir.entryInfoList(filters, QDir::Files, QDir::Name);
|
||||
|
||||
// iterate variants
|
||||
for (QFileInfoList::iterator file = fileList.begin(); file != fileList.end(); file++) {
|
||||
for (QFileInfoList::iterator file = fileList.begin(); file != fileList.end(); ++file) {
|
||||
#ifndef COLORED_NICKNAMES
|
||||
if (file->baseName().toLower() == "colored") {
|
||||
continue;
|
||||
|
@ -299,7 +299,7 @@ void ChatWidget::init(const RsPeerId &peerId, const QString &title)
|
||||
rsHistory->getMessages(peerId, historyMsgs, messageCount);
|
||||
|
||||
std::list<HistoryMsg>::iterator historyIt;
|
||||
for (historyIt = historyMsgs.begin(); historyIt != historyMsgs.end(); historyIt++)
|
||||
for (historyIt = historyMsgs.begin(); historyIt != historyMsgs.end(); ++historyIt)
|
||||
addChatMsg(historyIt->incoming, QString::fromUtf8(historyIt->peerName.c_str()), QDateTime::fromTime_t(historyIt->sendTime), QDateTime::fromTime_t(historyIt->recvTime), QString::fromUtf8(historyIt->message.c_str()), MSGTYPE_HISTORY);
|
||||
}
|
||||
}
|
||||
@ -537,7 +537,7 @@ void ChatWidget::completeNickname(bool reverse)
|
||||
std::list<QString> participants;
|
||||
for ( std::map<std::string,time_t>::const_iterator it = lobby->nick_names.begin();
|
||||
it != lobby->nick_names.end();
|
||||
it++) {
|
||||
++it) {
|
||||
participants.push_front(QString::fromUtf8(it->first.c_str()));
|
||||
}
|
||||
participants.sort(caseInsensitiveCompare);
|
||||
@ -616,7 +616,7 @@ QAbstractItemModel *ChatWidget::modelFromPeers()
|
||||
QStringList participants;
|
||||
for ( std::map<std::string,time_t>::const_iterator it = lobby->nick_names.begin();
|
||||
it != lobby->nick_names.end();
|
||||
it++) {
|
||||
++it) {
|
||||
participants.push_front(QString::fromUtf8(it->first.c_str()));
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ void PopupChatDialog::onChatChanged(int list, int type)
|
||||
ui.actionClearOfflineMessages->setEnabled(true);
|
||||
|
||||
std::list<ChatInfo>::iterator it;
|
||||
for(it = offlineChat.begin(); it != offlineChat.end(); it++) {
|
||||
for(it = offlineChat.begin(); it != offlineChat.end(); ++it) {
|
||||
/* are they public? */
|
||||
if ((it->chatflags & RS_CHAT_PRIVATE) == 0) {
|
||||
/* this should not happen */
|
||||
|
@ -76,7 +76,7 @@ void AvatarDefs::getAvatarFromGpgId(const std::string& gpgId, QPixmap &avatar, c
|
||||
std::list<RsPeerId> sslIds;
|
||||
if (rsPeers->getAssociatedSSLIds(RsPgpId(gpgId), sslIds)) {
|
||||
std::list<RsPeerId>::iterator sslId;
|
||||
for (sslId = sslIds.begin(); sslId != sslIds.end(); sslId++) {
|
||||
for (sslId = sslIds.begin(); sslId != sslIds.end(); ++sslId) {
|
||||
rsMsgs->getAvatarData(*sslId, data, size);
|
||||
if (size) {
|
||||
break;
|
||||
|
@ -75,7 +75,7 @@ void Emoticons::load()
|
||||
QString smfile;
|
||||
while(sm_codes[i] != '{')
|
||||
{
|
||||
i++;
|
||||
++i;
|
||||
}
|
||||
while (i < sm_codes.length()-2)
|
||||
{
|
||||
@ -84,27 +84,27 @@ void Emoticons::load()
|
||||
|
||||
while(sm_codes[i] != '\"')
|
||||
{
|
||||
i++;
|
||||
++i;
|
||||
}
|
||||
i++;
|
||||
++i;
|
||||
while (sm_codes[i] != '\"')
|
||||
{
|
||||
smcode += sm_codes[i];
|
||||
i++;
|
||||
++i;
|
||||
}
|
||||
i++;
|
||||
++i;
|
||||
|
||||
while(sm_codes[i] != '\"')
|
||||
{
|
||||
i++;
|
||||
++i;
|
||||
}
|
||||
i++;
|
||||
++i;
|
||||
while(sm_codes[i] != '\"' && sm_codes[i+1] != ';')
|
||||
{
|
||||
smfile += sm_codes[i];
|
||||
i++;
|
||||
++i;
|
||||
}
|
||||
i++;
|
||||
++i;
|
||||
if(!smcode.isEmpty() && !smfile.isEmpty()) {
|
||||
while (smcode.right(1) == "|") {
|
||||
smcode.remove(smcode.length() - 1, 1);
|
||||
@ -189,7 +189,7 @@ void Emoticons::showSmileyWidget(QWidget *parent, QWidget *button, const char *s
|
||||
if(x >= countPerLine)
|
||||
{
|
||||
x = 0;
|
||||
y++;
|
||||
++y;
|
||||
}
|
||||
QObject::connect(smButton, SIGNAL(clicked()), parent, slotAddMethod);
|
||||
QObject::connect(smButton, SIGNAL(clicked()), smWidget, SLOT(close()));
|
||||
|
@ -227,7 +227,7 @@ void FriendList::processSettings(bool bLoad)
|
||||
|
||||
// open groups
|
||||
int arrayIndex = Settings->beginReadArray("Groups");
|
||||
for (int index = 0; index < arrayIndex; index++) {
|
||||
for (int index = 0; index < arrayIndex; ++index) {
|
||||
Settings->setArrayIndex(index);
|
||||
addGroupToExpand(Settings->value("open").toString().toStdString());
|
||||
}
|
||||
@ -435,7 +435,7 @@ void FriendList::peerTreeWidgetCostumPopupMenu()
|
||||
|
||||
bool foundGroup = false;
|
||||
// add action for all groups, except the own group
|
||||
for (std::list<RsGroupInfo>::iterator groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); groupIt++) {
|
||||
for (std::list<RsGroupInfo>::iterator groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); ++groupIt) {
|
||||
if (std::find(groupIt->peerIds.begin(), groupIt->peerIds.end(), gpgId) == groupIt->peerIds.end()) {
|
||||
if (parent) {
|
||||
if (addToGroupMenu == NULL) {
|
||||
@ -625,7 +625,7 @@ void FriendList::insertPeers()
|
||||
QTreeWidgetItemIterator itemIterator(peerTreeWidget);
|
||||
QTreeWidgetItem *item;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
switch (item->type()) {
|
||||
case TYPE_GPG:
|
||||
{
|
||||
@ -648,7 +648,7 @@ void FriendList::insertPeers()
|
||||
std::string groupId = getRsId(parent);
|
||||
|
||||
// the parent is a group, check if the gpg id is assigned to the group
|
||||
for (groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); groupIt++) {
|
||||
for (groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); ++groupIt) {
|
||||
if (groupIt->id == groupId) {
|
||||
if (std::find(groupIt->peerIds.begin(), groupIt->peerIds.end(), gpg_widget_id) == groupIt->peerIds.end()) {
|
||||
delete(parent->takeChild(parent->indexOfChild(item)));
|
||||
@ -659,7 +659,7 @@ void FriendList::insertPeers()
|
||||
}
|
||||
} else {
|
||||
// gpg item without group, check if the gpg id is assigned to a group
|
||||
for (groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); groupIt++) {
|
||||
for (groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); ++groupIt) {
|
||||
if (std::find(groupIt->peerIds.begin(), groupIt->peerIds.end(), gpg_widget_id) != groupIt->peerIds.end()) {
|
||||
delete(peerTreeWidget->takeTopLevelItem(peerTreeWidget->indexOfTopLevelItem(item)));
|
||||
break;
|
||||
@ -680,12 +680,12 @@ void FriendList::insertPeers()
|
||||
} else if (groupsHasChanged) {
|
||||
// remove deleted groups
|
||||
std::string groupId = getRsId(item);
|
||||
for (groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); groupIt++) {
|
||||
for (groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); ++groupIt) {
|
||||
if (groupIt->id == groupId) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (groupIt == groupInfoList.end() || groupIt->peerIds.size() == 0) {
|
||||
if (groupIt == groupInfoList.end() || groupIt->peerIds.empty()) {
|
||||
if (item->parent()) {
|
||||
delete(item->parent()->takeChild(item->parent()->indexOfChild(item)));
|
||||
} else {
|
||||
@ -710,15 +710,15 @@ void FriendList::insertPeers()
|
||||
if (mShowGroups && groupIt != groupInfoList.end()) {
|
||||
groupInfo = &(*groupIt);
|
||||
|
||||
if ((groupInfo->flag & RS_GROUP_FLAG_STANDARD) && groupInfo->peerIds.size() == 0) {
|
||||
if ((groupInfo->flag & RS_GROUP_FLAG_STANDARD) && groupInfo->peerIds.empty()) {
|
||||
// don't show empty standard groups
|
||||
groupIt++;
|
||||
++groupIt;
|
||||
continue;
|
||||
}
|
||||
|
||||
// search existing group item
|
||||
int itemCount = peerTreeWidget->topLevelItemCount();
|
||||
for (int index = 0; index < itemCount; index++) {
|
||||
for (int index = 0; index < itemCount; ++index) {
|
||||
QTreeWidgetItem *groupItemLoop = peerTreeWidget->topLevelItem(index);
|
||||
if (groupItemLoop->type() == TYPE_GROUP && getRsId(groupItemLoop) == groupInfo->id) {
|
||||
groupItem = groupItemLoop;
|
||||
@ -756,7 +756,7 @@ void FriendList::insertPeers()
|
||||
continue;
|
||||
}
|
||||
}
|
||||
childIndex++;
|
||||
++childIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@ -768,7 +768,7 @@ void FriendList::insertPeers()
|
||||
}
|
||||
|
||||
// iterate through gpg friends
|
||||
for (gpgIt = gpgFriends.begin(); gpgIt != gpgFriends.end(); gpgIt++) {
|
||||
for (gpgIt = gpgFriends.begin(); gpgIt != gpgFriends.end(); ++gpgIt) {
|
||||
RsPgpId gpgId = *gpgIt;
|
||||
|
||||
if (mShowGroups) {
|
||||
@ -799,7 +799,7 @@ void FriendList::insertPeers()
|
||||
|
||||
// search existing gpg item
|
||||
int itemCount = groupItem ? groupItem->childCount() : peerTreeWidget->topLevelItemCount();
|
||||
for (int index = 0; index < itemCount; index++) {
|
||||
for (int index = 0; index < itemCount; ++index) {
|
||||
gpgItemLoop = groupItem ? groupItem->child(index) : peerTreeWidget->topLevelItem(index);
|
||||
if (gpgItemLoop->type() == TYPE_GPG && getRsId(gpgItemLoop) == gpgId.toStdString()) {
|
||||
gpgItem = gpgItemLoop;
|
||||
@ -844,7 +844,7 @@ void FriendList::insertPeers()
|
||||
gpgItem->setSizeHint(COLUMN_NAME, QSize(26, 26));
|
||||
}
|
||||
|
||||
availableCount++;
|
||||
++availableCount;
|
||||
|
||||
QString gpgItemText = QString::fromUtf8(detail.name.c_str());
|
||||
|
||||
@ -858,7 +858,7 @@ void FriendList::insertPeers()
|
||||
// count again
|
||||
childCount = gpgItem->childCount();
|
||||
} else {
|
||||
childIndex++;
|
||||
++childIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@ -875,14 +875,14 @@ void FriendList::insertPeers()
|
||||
QString itemIP;
|
||||
|
||||
rsPeers->getAssociatedSSLIds(detail.gpg_id, sslContacts);
|
||||
for (std::list<RsPeerId>::iterator sslIt = sslContacts.begin(); sslIt != sslContacts.end(); sslIt++) {
|
||||
for (std::list<RsPeerId>::iterator sslIt = sslContacts.begin(); sslIt != sslContacts.end(); ++sslIt) {
|
||||
QTreeWidgetItem *sslItem = NULL;
|
||||
RsPeerId sslId = *sslIt;
|
||||
|
||||
//find the corresponding sslItem child item of the gpg item
|
||||
bool newChild = true;
|
||||
childCount = gpgItem->childCount();
|
||||
for (int childIndex = 0; childIndex < childCount; childIndex++) {
|
||||
for (int childIndex = 0; childIndex < childCount; ++childIndex) {
|
||||
// we assume, that only ssl items are child of the gpg item, so we don't need to test the type
|
||||
if (getRsId(gpgItem->child(childIndex)) == sslId.toStdString()) {
|
||||
sslItem = gpgItem->child(childIndex);
|
||||
@ -972,7 +972,7 @@ void FriendList::insertPeers()
|
||||
int peerState = 0;
|
||||
int rsState = 0;
|
||||
std::list<StatusInfo>::iterator it;
|
||||
for(it = statusInfo.begin(); it != statusInfo.end(); it++) {
|
||||
for(it = statusInfo.begin(); it != statusInfo.end(); ++it) {
|
||||
if(it->id == sslId){
|
||||
rsState = it->status;
|
||||
switch (rsState) {
|
||||
@ -1058,7 +1058,7 @@ void FriendList::insertPeers()
|
||||
}
|
||||
sslItem -> setIcon(COLUMN_NAME, sslIcon);
|
||||
|
||||
for (int i = 0; i < COLUMN_COUNT; i++) {
|
||||
for (int i = 0; i < COLUMN_COUNT; ++i) {
|
||||
sslItem -> setTextColor(i, sslColor);
|
||||
sslItem -> setFont(i, sslFont);
|
||||
}
|
||||
@ -1068,7 +1068,7 @@ void FriendList::insertPeers()
|
||||
if (gpg_connected) {
|
||||
gpgItem->setHidden(false);
|
||||
|
||||
onlineCount++;
|
||||
++onlineCount;
|
||||
|
||||
if (bestPeerState == 0) {
|
||||
// show as online
|
||||
@ -1078,7 +1078,7 @@ void FriendList::insertPeers()
|
||||
|
||||
QColor textColor = mTextColorStatus[bestRSState];
|
||||
QFont font = StatusDefs::font(bestRSState);
|
||||
for(int i = 0; i < COLUMN_COUNT; i++) {
|
||||
for(int i = 0; i < COLUMN_COUNT; ++i) {
|
||||
gpgItem->setTextColor(i, textColor);
|
||||
gpgItem->setFont(i, font);
|
||||
}
|
||||
@ -1106,14 +1106,14 @@ void FriendList::insertPeers()
|
||||
}
|
||||
|
||||
bestPeerState = PEER_STATE_AVAILABLE;
|
||||
onlineCount++;
|
||||
++onlineCount;
|
||||
gpgItem->setHidden(mHideUnconnected);
|
||||
gpgIcon = QIcon(IMAGE_AVAILABLE);
|
||||
|
||||
QFont font;
|
||||
font.setBold(true);
|
||||
QColor textColor = mTextColorStatus[RS_STATUS_ONLINE];
|
||||
for(int i = 0; i < COLUMN_COUNT; i++) {
|
||||
for(int i = 0; i < COLUMN_COUNT; ++i) {
|
||||
gpgItem->setTextColor(i, textColor);
|
||||
gpgItem->setFont(i,font);
|
||||
}
|
||||
@ -1130,7 +1130,7 @@ void FriendList::insertPeers()
|
||||
|
||||
QColor textColor = mTextColorStatus[RS_STATUS_OFFLINE];
|
||||
QFont font = StatusDefs::font(RS_STATUS_OFFLINE);
|
||||
for(int i = 0; i < COLUMN_COUNT; i++) {
|
||||
for(int i = 0; i < COLUMN_COUNT; ++i) {
|
||||
gpgItem->setTextColor(i, textColor);
|
||||
gpgItem->setFont(i, font);
|
||||
}
|
||||
@ -1177,7 +1177,7 @@ void FriendList::insertPeers()
|
||||
}
|
||||
|
||||
if (mShowGroups && groupIt != groupInfoList.end()) {
|
||||
groupIt++;
|
||||
++groupIt;
|
||||
} else {
|
||||
// all done
|
||||
break;
|
||||
@ -1211,7 +1211,7 @@ void FriendList::insertPeers()
|
||||
bool FriendList::getExpandedGroups(std::set<std::string> &groups) const
|
||||
{
|
||||
int itemCount = ui->peerTreeWidget->topLevelItemCount();
|
||||
for (int index = 0; index < itemCount; index++) {
|
||||
for (int index = 0; index < itemCount; ++index) {
|
||||
QTreeWidgetItem *item = ui->peerTreeWidget->topLevelItem(index);
|
||||
if (item->type() == TYPE_GROUP && item->isExpanded()) {
|
||||
groups.insert(item->data(COLUMN_DATA, ROLE_ID).toString().toStdString());
|
||||
@ -1405,7 +1405,7 @@ QTreeWidgetItem *FriendList::getCurrentPeer() const
|
||||
/* Display the columns of this item. */
|
||||
QString out = "CurrentPeerItem: \n";
|
||||
|
||||
for(int i = 1; i < COLUMN_COUNT; i++)
|
||||
for(int i = 1; i < COLUMN_COUNT; ++i)
|
||||
{
|
||||
QString txt = item -> text(i);
|
||||
out += QString("\t%1:%2\n").arg(i).arg(txt);
|
||||
@ -1493,7 +1493,7 @@ void FriendList::connectfriend()
|
||||
{
|
||||
if (c->type() == TYPE_GPG) {
|
||||
int childCount = c->childCount();
|
||||
for (int childIndex = 0; childIndex < childCount; childIndex++) {
|
||||
for (int childIndex = 0; childIndex < childCount; ++childIndex) {
|
||||
QTreeWidgetItem *item = c->child(childIndex);
|
||||
if (item->type() == TYPE_SSL) {
|
||||
rsPeers->connectAttempt(RsPeerId(getRsId(item)));
|
||||
@ -1840,7 +1840,7 @@ void FriendList::setShowGroups(bool show)
|
||||
childCount = ui->peerTreeWidget->topLevelItemCount();
|
||||
continue;
|
||||
}
|
||||
childIndex++;
|
||||
++childIndex;
|
||||
}
|
||||
}
|
||||
insertPeers();
|
||||
@ -1871,7 +1871,7 @@ void FriendList::setBigName(bool bigName)
|
||||
if ((*it)->type() == TYPE_GPG) {
|
||||
(*it)->setSizeHint(COLUMN_NAME, newSize);
|
||||
}
|
||||
it++;
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1883,7 +1883,7 @@ void FriendList::filterItems(const QString &text)
|
||||
{
|
||||
filterText = text;
|
||||
int count = ui->peerTreeWidget->topLevelItemCount();
|
||||
for (int index = 0; index < count; index++) {
|
||||
for (int index = 0; index < count; ++index) {
|
||||
FriendList::filterItem(ui->peerTreeWidget->topLevelItem(index), filterText);
|
||||
}
|
||||
|
||||
@ -1906,9 +1906,9 @@ bool FriendList::filterItem(QTreeWidgetItem *item, const QString &text)
|
||||
|
||||
int visibleChildCount = 0;
|
||||
int count = item->childCount();
|
||||
for (int index = 0; index < count; index++) {
|
||||
for (int index = 0; index < count; ++index) {
|
||||
if (FriendList::filterItem(item->child(index), text)) {
|
||||
visibleChildCount++;
|
||||
++visibleChildCount;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ static void initSslItem(QTreeWidgetItem *item, const RsPeerDetails &detail, cons
|
||||
int state = RS_STATUS_OFFLINE;
|
||||
if (detail.state & RS_PEER_STATE_CONNECTED) {
|
||||
std::list<StatusInfo>::const_iterator it;
|
||||
for (it = statusInfo.begin(); it != statusInfo.end() ; it++) {
|
||||
for (it = statusInfo.begin(); it != statusInfo.end() ; ++it) {
|
||||
if (it->id == detail.id) {
|
||||
state = it->status;
|
||||
break;
|
||||
@ -325,9 +325,9 @@ void FriendSelectionWidget::secured_fillList()
|
||||
{
|
||||
groupInfo = &(*groupIt);
|
||||
|
||||
if (groupInfo->peerIds.size() == 0) {
|
||||
if (groupInfo->peerIds.empty()) {
|
||||
// don't show empty groups
|
||||
groupIt++;
|
||||
++groupIt;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -364,7 +364,7 @@ void FriendSelectionWidget::secured_fillList()
|
||||
if (mShowTypes & (SHOW_GPG | SHOW_NON_FRIEND_GPG))
|
||||
{
|
||||
// iterate through gpg ids
|
||||
for (gpgIt = gpgIds.begin(); gpgIt != gpgIds.end(); gpgIt++) {
|
||||
for (gpgIt = gpgIds.begin(); gpgIt != gpgIds.end(); ++gpgIt) {
|
||||
if (groupInfo) {
|
||||
// we fill a group, check if gpg id is assigned
|
||||
if (std::find(groupInfo->peerIds.begin(), groupInfo->peerIds.end(), *gpgIt) == groupInfo->peerIds.end()) {
|
||||
@ -395,7 +395,7 @@ void FriendSelectionWidget::secured_fillList()
|
||||
rsPeers->getAssociatedSSLIds(*gpgIt, sslIds);
|
||||
|
||||
int state = RS_STATUS_OFFLINE;
|
||||
for (statusIt = statusInfo.begin(); statusIt != statusInfo.end() ; statusIt++) {
|
||||
for (statusIt = statusInfo.begin(); statusIt != statusInfo.end() ; ++statusIt) {
|
||||
if (std::find(sslIds.begin(), sslIds.end(), statusIt->id) != sslIds.end()) {
|
||||
if (statusIt->status != RS_STATUS_OFFLINE) {
|
||||
state = RS_STATUS_ONLINE;
|
||||
@ -430,7 +430,7 @@ void FriendSelectionWidget::secured_fillList()
|
||||
|
||||
if (mShowTypes & SHOW_SSL) {
|
||||
// iterate through associated ssl ids
|
||||
for (sslIt = sslIds.begin(); sslIt != sslIds.end(); sslIt++) {
|
||||
for (sslIt = sslIds.begin(); sslIt != sslIds.end(); ++sslIt) {
|
||||
RsPeerDetails detail;
|
||||
if (!rsPeers->getPeerDetails(*sslIt, detail)) {
|
||||
continue; /* BAD */
|
||||
@ -465,7 +465,7 @@ void FriendSelectionWidget::secured_fillList()
|
||||
else
|
||||
{
|
||||
// iterate through ssl ids
|
||||
for (sslIt = sslIds.begin(); sslIt != sslIds.end(); sslIt++) {
|
||||
for (sslIt = sslIds.begin(); sslIt != sslIds.end(); ++sslIt) {
|
||||
RsPeerDetails detail;
|
||||
if (!rsPeers->getPeerDetails(*sslIt, detail)) {
|
||||
continue; /* BAD */
|
||||
@ -514,7 +514,7 @@ void FriendSelectionWidget::secured_fillList()
|
||||
if(mShowTypes & SHOW_GXS)
|
||||
{
|
||||
// iterate through gpg ids
|
||||
for (std::vector<RsGxsGroupId>::const_iterator gxsIt = gxsIds.begin(); gxsIt != gxsIds.end(); gxsIt++)
|
||||
for (std::vector<RsGxsGroupId>::const_iterator gxsIt = gxsIds.begin(); gxsIt != gxsIds.end(); ++gxsIt)
|
||||
{
|
||||
// we fill the not assigned gpg ids
|
||||
if (std::find(filledIds.begin(), filledIds.end(), (*gxsIt).toStdString()) != filledIds.end())
|
||||
@ -553,7 +553,7 @@ void FriendSelectionWidget::secured_fillList()
|
||||
}
|
||||
}
|
||||
if (groupIt != groupInfoList.end()) {
|
||||
groupIt++;
|
||||
++groupIt;
|
||||
} else {
|
||||
// all done
|
||||
break;
|
||||
@ -628,7 +628,7 @@ void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status)
|
||||
std::list<StatusInfo>::iterator statusIt;
|
||||
rsStatus->getStatusList(statusInfo);
|
||||
|
||||
for (statusIt = statusInfo.begin(); statusIt != statusInfo.end() ; statusIt++) {
|
||||
for (statusIt = statusInfo.begin(); statusIt != statusInfo.end() ; ++statusIt) {
|
||||
if (std::find(sslIds.begin(), sslIds.end(), statusIt->id) != sslIds.end()) {
|
||||
if (statusIt->status != RS_STATUS_OFFLINE) {
|
||||
gpgStatus = RS_STATUS_ONLINE;
|
||||
@ -645,7 +645,7 @@ void FriendSelectionWidget::peerStatusChanged(const QString& peerId, int status)
|
||||
QTreeWidgetItemIterator itemIterator(ui->friendList);
|
||||
QTreeWidgetItem *item;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
bool bFoundGPG = false;
|
||||
bool bFoundSSL = false;
|
||||
@ -827,7 +827,7 @@ void FriendSelectionWidget::itemChanged(QTreeWidgetItem *item, int column)
|
||||
void FriendSelectionWidget::filterItems(const QString& text)
|
||||
{
|
||||
int count = ui->friendList->topLevelItemCount();
|
||||
for (int index = 0; index < count; index++) {
|
||||
for (int index = 0; index < count; ++index) {
|
||||
filterItem(ui->friendList->topLevelItem(index), text);
|
||||
}
|
||||
}
|
||||
@ -844,9 +844,9 @@ bool FriendSelectionWidget::filterItem(QTreeWidgetItem *item, const QString &tex
|
||||
|
||||
int visibleChildCount = 0;
|
||||
int count = item->childCount();
|
||||
for (int index = 0; index < count; index++) {
|
||||
for (int index = 0; index < count; ++index) {
|
||||
if (filterItem(item->child(index), text)) {
|
||||
visibleChildCount++;
|
||||
++visibleChildCount;
|
||||
}
|
||||
}
|
||||
|
||||
@ -881,7 +881,7 @@ void FriendSelectionWidget::selectedIds(IdType idType, std::list<std::string> &i
|
||||
QTreeWidgetItemIterator itemIterator(ui->friendList);
|
||||
QTreeWidgetItem *item;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
std::string id;
|
||||
|
||||
@ -955,7 +955,7 @@ void FriendSelectionWidget::setSelectedIds(IdType idType, const std::list<std::s
|
||||
QTreeWidgetItemIterator itemIterator(ui->friendList);
|
||||
QTreeWidgetItem *item;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
std::string id = idFromItem(item);
|
||||
IdType itemType = idTypeFromItem(item);
|
||||
@ -986,7 +986,7 @@ void FriendSelectionWidget::itemsFromId(IdType idType, const std::string &id, QL
|
||||
QTreeWidgetItemIterator itemIterator(ui->friendList);
|
||||
QTreeWidgetItem *item;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
if (idType == idTypeFromItem(item) && idFromItem(item) == id) {
|
||||
items.push_back(item);
|
||||
@ -999,7 +999,7 @@ void FriendSelectionWidget::items(QList<QTreeWidgetItem*> &_items, IdType idType
|
||||
QTreeWidgetItemIterator itemIterator(ui->friendList);
|
||||
QTreeWidgetItem *item;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
if (idType == IDTYPE_NONE || idType == idTypeFromItem(item)) {
|
||||
_items.push_back(item);
|
||||
|
@ -225,7 +225,7 @@ void GroupTreeWidget::updateColors()
|
||||
QTreeWidgetItemIterator itemIterator(ui->treeWidget);
|
||||
QTreeWidgetItem *item;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
int color = item->data(COLUMN_DATA, ROLE_COLOR).toInt();
|
||||
if (color >= 0) {
|
||||
@ -320,14 +320,14 @@ void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList<
|
||||
|
||||
/* Iterate all items */
|
||||
QList<GroupItemInfo>::const_iterator it;
|
||||
for (it = itemList.begin(); it != itemList.end(); it++) {
|
||||
for (it = itemList.begin(); it != itemList.end(); ++it) {
|
||||
const GroupItemInfo &itemInfo = *it;
|
||||
|
||||
QTreeWidgetItem *item = NULL;
|
||||
|
||||
/* Search exisiting item */
|
||||
int childCount = categoryItem->childCount();
|
||||
for (int child = 0; child < childCount; child++) {
|
||||
for (int child = 0; child < childCount; ++child) {
|
||||
QTreeWidgetItem *childItem = categoryItem->child(child);
|
||||
if (childItem->data(COLUMN_DATA, ROLE_ID).toString() == itemInfo.id) {
|
||||
/* Found child */
|
||||
@ -388,7 +388,7 @@ void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList<
|
||||
while (child < childCount) {
|
||||
QString id = categoryItem->child(child)->data(COLUMN_DATA, ROLE_ID).toString();
|
||||
|
||||
for (it = itemList.begin(); it != itemList.end(); it++) {
|
||||
for (it = itemList.begin(); it != itemList.end(); ++it) {
|
||||
if (it->id == id) {
|
||||
break;
|
||||
}
|
||||
@ -398,7 +398,7 @@ void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList<
|
||||
delete(categoryItem->takeChild(child));
|
||||
childCount = categoryItem->childCount();
|
||||
} else {
|
||||
child++;
|
||||
++child;
|
||||
}
|
||||
}
|
||||
|
||||
@ -435,7 +435,7 @@ QTreeWidgetItem *GroupTreeWidget::getItemFromId(const QString &id)
|
||||
QTreeWidgetItemIterator itemIterator(ui->treeWidget);
|
||||
QTreeWidgetItem *item;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
if (item->parent() == NULL) {
|
||||
continue;
|
||||
@ -526,7 +526,7 @@ void GroupTreeWidget::calculateScore(QTreeWidgetItem *item, const QString &filte
|
||||
QTreeWidgetItemIterator itemIterator(ui->treeWidget);
|
||||
QTreeWidgetItem *tmpItem;
|
||||
while ((tmpItem = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
if (tmpItem->data(COLUMN_DATA, ROLE_ID).toString().isEmpty()) {
|
||||
continue;
|
||||
@ -563,7 +563,7 @@ void GroupTreeWidget::resort(QTreeWidgetItem *categoryItem)
|
||||
categoryItem->sortChildren(COLUMN_DATA, order);
|
||||
} else {
|
||||
int count = ui->treeWidget->topLevelItemCount();
|
||||
for (int child = 0; child < count; child++) {
|
||||
for (int child = 0; child < count; ++child) {
|
||||
ui->treeWidget->topLevelItem(child)->sortChildren(COLUMN_DATA, order);
|
||||
}
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ PictureFlowState::PictureFlowState():
|
||||
|
||||
PictureFlowState::~PictureFlowState()
|
||||
{
|
||||
for(int i = 0; i < (int)slideImages.count(); i++)
|
||||
for(int i = 0; i < (int)slideImages.count(); ++i)
|
||||
delete slideImages[i];
|
||||
}
|
||||
|
||||
@ -317,7 +317,7 @@ void PictureFlowState::reset()
|
||||
centerSlide.slideIndex = centerIndex;
|
||||
centerSlide.blend = 256;
|
||||
|
||||
for(int i = 0; i < (int)leftSlides.count(); i++) {
|
||||
for(int i = 0; i < (int)leftSlides.count(); ++i) {
|
||||
SlideInfo& si = leftSlides[i];
|
||||
si.angle = angle;
|
||||
si.cx = -(offsetX + spacing*i*PFREAL_ONE);
|
||||
@ -326,14 +326,14 @@ void PictureFlowState::reset()
|
||||
si.blend = 256 * (((int)leftSlides.count()-i)/(float)leftSlides.count());
|
||||
}//for(int i = 0; i < (int)leftSlides.count(); i++)
|
||||
|
||||
for(int i = 0; i < (int)rightSlides.count(); i++) {
|
||||
for(int i = 0; i < (int)rightSlides.count(); ++i) {
|
||||
SlideInfo& si = rightSlides[i];
|
||||
si.angle = -angle;
|
||||
si.cx = offsetX + spacing*i*PFREAL_ONE;
|
||||
si.cy = offsetY;
|
||||
si.slideIndex = centerIndex+1+i;
|
||||
si.blend = 256 * (((int)rightSlides.count()-i)/(float)rightSlides.count());
|
||||
}//for(int i = 0; i < (int)rightSlides.count(); i++
|
||||
}//for(int i = 0; i < (int)rightSlides.count(); ++i
|
||||
}
|
||||
|
||||
// ------------- PictureFlowAnimator ---------------------------------------
|
||||
@ -394,15 +394,15 @@ void PictureFlowAnimator::update()
|
||||
PFreal ftick = (tick * PFREAL_ONE) >> 16;
|
||||
|
||||
if(step < 0)
|
||||
index++;
|
||||
++index;
|
||||
|
||||
if(state->centerIndex != index) {
|
||||
state->centerIndex = index;
|
||||
frame = index << 16;
|
||||
state->centerSlide.slideIndex = state->centerIndex;
|
||||
for(int i = 0; i < (int)state->leftSlides.count(); i++)
|
||||
for(int i = 0; i < (int)state->leftSlides.count(); ++i)
|
||||
state->leftSlides[i].slideIndex = state->centerIndex-1-i;
|
||||
for(int i = 0; i < (int)state->rightSlides.count(); i++)
|
||||
for(int i = 0; i < (int)state->rightSlides.count(); ++i)
|
||||
state->rightSlides[i].slideIndex = state->centerIndex+1+i;
|
||||
}//if(state->centerIndex != index)
|
||||
|
||||
@ -416,19 +416,19 @@ void PictureFlowAnimator::update()
|
||||
return;
|
||||
}//if(state->centerIndex == target)
|
||||
|
||||
for(int i = 0; i < (int)state->leftSlides.count(); i++) {
|
||||
for(int i = 0; i < (int)state->leftSlides.count(); ++i) {
|
||||
SlideInfo& si = state->leftSlides[i];
|
||||
si.angle = state->angle;
|
||||
si.cx = -(state->offsetX + state->spacing*i*PFREAL_ONE + step*state->spacing*ftick);
|
||||
si.cy = state->offsetY;
|
||||
}//for(int i = 0; i < (int)state->leftSlides.count(); i++)
|
||||
}//for(int i = 0; i < (int)state->leftSlides.count(); ++i)
|
||||
|
||||
for(int i = 0; i < (int)state->rightSlides.count(); i++) {
|
||||
for(int i = 0; i < (int)state->rightSlides.count(); ++i) {
|
||||
SlideInfo& si = state->rightSlides[i];
|
||||
si.angle = -state->angle;
|
||||
si.cx = state->offsetX + state->spacing*i*PFREAL_ONE - step*state->spacing*ftick;
|
||||
si.cy = state->offsetY;
|
||||
}//for(int i = 0; i < (int)state->rightSlides.count(); i++)
|
||||
}//for(int i = 0; i < (int)state->rightSlides.count(); ++i)
|
||||
|
||||
if(step > 0) {
|
||||
PFreal ftick = (neg * PFREAL_ONE) >> 16;
|
||||
@ -452,20 +452,20 @@ void PictureFlowAnimator::update()
|
||||
int nleft = state->leftSlides.count();
|
||||
int nright = state->rightSlides.count();
|
||||
|
||||
for(int index = 0; index < nleft; index++) {
|
||||
for(int index = 0; index < nleft; ++index) {
|
||||
int startBlend = 256 * ((nleft-index)/(float)nleft);
|
||||
int stopBlend = 256 * ((nleft-index-step)/(float)nleft);
|
||||
int blend = startBlend + ((stopBlend-startBlend) * (tick/65535.0)) ;
|
||||
if ((index==0) && (step<0)) blend = 256;//Is center
|
||||
state->leftSlides[index].blend = blend;
|
||||
}//for(int index = 0; index < nleft; index++)
|
||||
for(int index = 0; index < nright; index++) {
|
||||
}//for(int index = 0; index < nleft; ++index)
|
||||
for(int index = 0; index < nright; ++index) {
|
||||
int startBlend = 256 * ((nright-index)/(float)nright);
|
||||
int stopBlend = 256 * ((nright-index+step)/(float)nright);
|
||||
int blend = startBlend + ((stopBlend-startBlend) * (tick/65535.0)) ;
|
||||
if ((index==0) && (step>0)) blend = 256;//Is center
|
||||
state->rightSlides[index].blend = blend;
|
||||
}//for(int index = 0; index < nright; index++)
|
||||
}//for(int index = 0; index < nright; ++index)
|
||||
}
|
||||
|
||||
// ------------- PictureFlowSoftwareRenderer ---------------------------------------
|
||||
@ -533,11 +533,11 @@ void PictureFlowSoftwareRenderer::init()
|
||||
buffer.fill(bgcolor);
|
||||
|
||||
rays.resize(w*2);
|
||||
for(int i = 0; i < w; i++) {
|
||||
for(int i = 0; i < w; ++i) {
|
||||
PFreal gg = ((PFREAL_ONE >> 1) + i * PFREAL_ONE) / (2*h);
|
||||
rays[w-i-1] = -gg;
|
||||
rays[w+i] = gg;
|
||||
}//for(int i = 0; i < w; i++)
|
||||
}//for(int i = 0; i < w; ++i)
|
||||
|
||||
dirty = true;
|
||||
}
|
||||
@ -580,19 +580,19 @@ static QImage* prepareSurface(const QImage* slideImage, int w, int h, QRgb bgcol
|
||||
// transpose the image, this is to speed-up the rendering
|
||||
// because we process one column at a time
|
||||
// (and much better and faster to work row-wise, i.e in one scanline)
|
||||
for(int x = 0; x < w; x++)
|
||||
for(int y = 0; y < h; y++)
|
||||
for(int x = 0; x < w; ++x)
|
||||
for(int y = 0; y < h; ++y)
|
||||
result->setPixel(hofs + y, x, img.pixel(x, y));
|
||||
|
||||
if(reflectionEffect != PictureFlow::NoReflection) {
|
||||
// create the reflection
|
||||
int ht = hs - h - hofs;
|
||||
int hte = ht;
|
||||
for(int x = 0; x < w; x++)
|
||||
for(int y = 0; y < ht; y++) {
|
||||
for(int x = 0; x < w; ++x)
|
||||
for(int y = 0; y < ht; ++y) {
|
||||
QRgb color = img.pixel(x, img.height()-y-1);
|
||||
result->setPixel(h+hofs+y, x, blendColor(color,bgcolor,128*(hte-y)/hte));
|
||||
}//for(int y = 0; y < ht; y++)
|
||||
}//for(int y = 0; y < ht; ++y)
|
||||
|
||||
if(reflectionEffect == PictureFlow::BlurredReflection) {
|
||||
// blur the reflection everything first
|
||||
@ -611,55 +611,55 @@ static QImage* prepareSurface(const QImage* slideImage, int w, int h, QRgb bgcol
|
||||
|
||||
// how many times blur is applied?
|
||||
// for low-end system, limit this to only 1 loop
|
||||
for(int loop = 0; loop < 2; loop++) {
|
||||
for(int col = c1; col <= c2; col++) {
|
||||
for(int loop = 0; loop < 2; ++loop) {
|
||||
for(int col = c1; col <= c2; ++col) {
|
||||
p = result->scanLine(r1) + col*4;
|
||||
for(int i = 0; i < 3; i++)
|
||||
for(int i = 0; i < 3; ++i)
|
||||
rgba[i] = p[i] << 4;
|
||||
|
||||
p += bpl;
|
||||
for(int j = r1; j < r2; j++, p += bpl)
|
||||
for(int i = 0; i < 3; i++)
|
||||
for(int j = r1; j < r2; ++j, p += bpl)
|
||||
for(int i = 0; i < 3; ++i)
|
||||
p[i] = (rgba[i] += (((p[i]<<4)-rgba[i])) >> 1) >> 4;
|
||||
}//for(int col = c1; col <= c2; col++)
|
||||
}//for(int col = c1; col <= c2; ++col)
|
||||
|
||||
for(int row = r1; row <= r2; row++) {
|
||||
for(int row = r1; row <= r2; ++row) {
|
||||
p = result->scanLine(row) + c1*4;
|
||||
for(int i = 0; i < 3; i++)
|
||||
for(int i = 0; i < 3; ++i)
|
||||
rgba[i] = p[i] << 4;
|
||||
|
||||
p += 4;
|
||||
for(int j = c1; j < c2; j++, p+=4)
|
||||
for(int i = 0; i < 3; i++)
|
||||
for(int j = c1; j < c2; ++j, p+=4)
|
||||
for(int i = 0; i < 3; ++i)
|
||||
p[i] = (rgba[i] += (((p[i]<<4)-rgba[i])) >> 1) >> 4;
|
||||
}//for(int row = r1; row <= r2; row++)
|
||||
}//for(int row = r1; row <= r2; ++row)
|
||||
|
||||
for(int col = c1; col <= c2; col++) {
|
||||
for(int col = c1; col <= c2; ++col) {
|
||||
p = result->scanLine(r2) + col*4;
|
||||
for(int i = 0; i < 3; i++)
|
||||
for(int i = 0; i < 3; ++i)
|
||||
rgba[i] = p[i] << 4;
|
||||
|
||||
p -= bpl;
|
||||
for(int j = r1; j < r2; j++, p -= bpl)
|
||||
for(int i = 0; i < 3; i++)
|
||||
for(int j = r1; j < r2; ++j, p -= bpl)
|
||||
for(int i = 0; i < 3; ++i)
|
||||
p[i] = (rgba[i] += (((p[i]<<4)-rgba[i])) >> 1) >> 4;
|
||||
}//for(int col = c1; col <= c2; col++)
|
||||
}//for(int col = c1; col <= c2; ++col)
|
||||
|
||||
for(int row = r1; row <= r2; row++) {
|
||||
for(int row = r1; row <= r2; ++row) {
|
||||
p = result->scanLine(row) + c2*4;
|
||||
for(int i = 0; i < 3; i++)
|
||||
for(int i = 0; i < 3; ++i)
|
||||
rgba[i] = p[i] << 4;
|
||||
|
||||
p -= 4;
|
||||
for(int j = c1; j < c2; j++, p-=4)
|
||||
for(int i = 0; i < 3; i++)
|
||||
for(int j = c1; j < c2; ++j, p-=4)
|
||||
for(int i = 0; i < 3; ++i)
|
||||
p[i] = (rgba[i] += (((p[i]<<4)-rgba[i])) >> 1) >> 4;
|
||||
}//for(int row = r1; row <= r2; row++)
|
||||
}//for(int loop = 0; loop < 2; loop++)
|
||||
}//for(int row = r1; row <= r2; ++row)
|
||||
}//for(int loop = 0; loop < 2; ++loop)
|
||||
|
||||
// overdraw to leave only the reflection blurred (but not the actual image)
|
||||
for(int x = 0; x < w; x++)
|
||||
for(int y = 0; y < h; y++)
|
||||
for(int x = 0; x < w; ++x)
|
||||
for(int y = 0; y < h; ++y)
|
||||
result->setPixel(hofs + y, x, img.pixel(x, y));
|
||||
}//if(reflectionEffect == PictureFlow::BlurredReflection)
|
||||
}//if(reflectionEffect != PictureFlow::NoReflection)
|
||||
@ -790,7 +790,7 @@ QRect PictureFlowSoftwareRenderer::renderSlide(const SlideInfo &slide, int col1,
|
||||
|
||||
bool flag = false;
|
||||
rect.setLeft(xi);
|
||||
for(int x = qMax(xi, col1); x <= col2; x++) {
|
||||
for(int x = qMax(xi, col1); x <= col2; ++x) {
|
||||
PFreal hity = 0;
|
||||
PFreal fk = rays[x];
|
||||
if(sdy) {
|
||||
@ -834,8 +834,8 @@ QRect PictureFlowSoftwareRenderer::renderSlide(const SlideInfo &slide, int col1,
|
||||
*pixel2 = ptr[p2 >> PFREAL_SHIFT];
|
||||
p1 -= dy;
|
||||
p2 += dy;
|
||||
y1--;
|
||||
y2++;
|
||||
--y1;
|
||||
++y2;
|
||||
pixel1 -= pixelstep;
|
||||
pixel2 += pixelstep;
|
||||
}//while((y1 >= 0) && (y2 < h) && (p1 >= 0))
|
||||
@ -847,12 +847,12 @@ QRect PictureFlowSoftwareRenderer::renderSlide(const SlideInfo &slide, int col1,
|
||||
*pixel2 = blendColor(c2, bgcolor, blend);
|
||||
p1 -= dy;
|
||||
p2 += dy;
|
||||
y1--;
|
||||
y2++;
|
||||
--y1;
|
||||
++y2;
|
||||
pixel1 -= pixelstep;
|
||||
pixel2 += pixelstep;
|
||||
}//while((y1 >= 0) && (y2 < h) && (p1 >= 0))
|
||||
}//for(int x = qMax(xi, col1); x <= col2; x++)
|
||||
}//for(int x = qMax(xi, col1); x <= col2; ++x)
|
||||
|
||||
rect.setTop(0);
|
||||
rect.setBottom(h-1);
|
||||
@ -870,23 +870,23 @@ void PictureFlowSoftwareRenderer::renderSlides()
|
||||
state->centerSlide.left=c1;
|
||||
state->centerSlide.right=c2;
|
||||
|
||||
for(int index = 0; index < nleft; index++) {
|
||||
for(int index = 0; index < nleft; ++index) {
|
||||
QRect rs = renderSlide(state->leftSlides[index], 0, c1-1);
|
||||
if(!rs.isEmpty()) {
|
||||
state->leftSlides[index].left=rs.left();
|
||||
state->leftSlides[index].right=rs.right();
|
||||
c1 = rs.left();
|
||||
}//if(!rs.isEmpty())
|
||||
}//for(int index = 0; index < nleft; index++)
|
||||
}//for(int index = 0; index < nleft; ++index)
|
||||
|
||||
for(int index = 0; index < nright; index++) {
|
||||
for(int index = 0; index < nright; ++index) {
|
||||
QRect rs = renderSlide(state->rightSlides[index], c2+1, buffer.width());
|
||||
if(!rs.isEmpty()){
|
||||
state->rightSlides[index].left=rs.left();
|
||||
state->rightSlides[index].right=rs.right();
|
||||
c2 = rs.right();
|
||||
}//if(!rs.isEmpty())
|
||||
}//for(int index = 0; index < nright; index++)
|
||||
}//for(int index = 0; index < nright; ++index)
|
||||
}
|
||||
|
||||
// Render the slides. Updates only the offscreen buffer.
|
||||
@ -1101,7 +1101,7 @@ void PictureFlow::setCenterIndex(int index)
|
||||
void PictureFlow::clear()
|
||||
{
|
||||
int c = d->state->slideImages.count();
|
||||
for(int i = 0; i < c; i++)
|
||||
for(int i = 0; i < c; ++i)
|
||||
delete d->state->slideImages[i];
|
||||
d->state->slideImages.resize(0);
|
||||
|
||||
|
@ -135,7 +135,7 @@ bool RSTreeWidgetItem::operator<(const QTreeWidgetItem &other) const
|
||||
}
|
||||
|
||||
QList<int>::iterator role;
|
||||
for (role = roles.begin(); role != roles.end(); role++) {
|
||||
for (role = roles.begin(); role != roles.end(); ++role) {
|
||||
// taken from "bool QTreeWidgetItem::operator<(const QTreeWidgetItem &other) const"
|
||||
const QVariant v1 = data(column, *role);
|
||||
const QVariant v2 = other.data(column, *role);
|
||||
|
@ -1077,7 +1077,7 @@ void RsCollectionDialog::download()
|
||||
QTreeWidgetItemIterator itemIterator(ui._fileEntriesTW);
|
||||
QTreeWidgetItem *item;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
if (item->checkState(COLUMN_FILE) == Qt::Checked) {
|
||||
std::cerr << item->data(COLUMN_HASH,ROLE_NAME).toString().toStdString()
|
||||
@ -1144,7 +1144,7 @@ void RsCollectionDialog::saveChild(QTreeWidgetItem *parentItem, ColFileInfo *par
|
||||
parentInfo->type = parentItem->data(COLUMN_HASH,ROLE_TYPE).toUInt();
|
||||
parentInfo->size = parentItem->data(COLUMN_SIZE,ROLE_SELSIZE).toULongLong();
|
||||
|
||||
for (int i=0; i<parentItem->childCount(); i++) {
|
||||
for (int i=0; i<parentItem->childCount(); ++i) {
|
||||
ColFileInfo child;
|
||||
saveChild(parentItem->child(i), &child);
|
||||
if (parentInfo->name != "") {
|
||||
|
@ -157,7 +157,7 @@ void RsCollectionFile::recursAddElements(QDomDocument& doc,const DirDetails& det
|
||||
|
||||
d.setAttribute(QString("name"),QString::fromUtf8(details.name.c_str())) ;
|
||||
|
||||
for (std::list<DirStub>::const_iterator it = details.children.begin(); it != details.children.end(); it++)
|
||||
for (std::list<DirStub>::const_iterator it = details.children.begin(); it != details.children.end(); ++it)
|
||||
{
|
||||
if (!it->ref)
|
||||
continue;
|
||||
@ -193,7 +193,7 @@ void RsCollectionFile::recursAddElements(QDomDocument& doc,const ColFileInfo& co
|
||||
|
||||
d.setAttribute(QString("name"),colFileInfo.name) ;
|
||||
|
||||
for (std::vector<ColFileInfo>::const_iterator it = colFileInfo.children.begin(); it != colFileInfo.children.end(); it++)
|
||||
for (std::vector<ColFileInfo>::const_iterator it = colFileInfo.children.begin(); it != colFileInfo.children.end(); ++it)
|
||||
{
|
||||
recursAddElements(doc,(*it),d) ;
|
||||
}
|
||||
@ -298,7 +298,7 @@ bool RsCollectionFile::checkFile(const QString& fileName, bool showError)
|
||||
if(file.atEnd())
|
||||
n-- ;
|
||||
else if(n < max_size)
|
||||
n++ ;
|
||||
++n ;
|
||||
}
|
||||
file.close();
|
||||
return true;
|
||||
|
@ -150,8 +150,8 @@ void ConfCertDialog::setServiceFlags()
|
||||
|
||||
void ConfCertDialog::loadAll()
|
||||
{
|
||||
for(QMap<RsPeerId, ConfCertDialog*>::iterator it = instances_ssl.begin(); it != instances_ssl.end(); it++) it.value()->load();
|
||||
for(QMap<RsPgpId , ConfCertDialog*>::iterator it = instances_pgp.begin(); it != instances_pgp.end(); it++) it.value()->load();
|
||||
for(QMap<RsPeerId, ConfCertDialog*>::iterator it = instances_ssl.begin(); it != instances_ssl.end(); ++it) it.value()->load();
|
||||
for(QMap<RsPgpId , ConfCertDialog*>::iterator it = instances_pgp.begin(); it != instances_pgp.end(); ++it) it.value()->load();
|
||||
}
|
||||
|
||||
void ConfCertDialog::load()
|
||||
|
@ -581,7 +581,7 @@ bool ConnectFriendWizard::validateCurrentPage()
|
||||
}
|
||||
|
||||
std::list<RsPeerId>::iterator toId;
|
||||
for (toId = toIds.begin(); toId != toIds.end(); toId++) {
|
||||
for (toId = toIds.begin(); toId != toIds.end(); ++toId) {
|
||||
MessageComposer::recommendFriend(recommendIds, *toId, ui->frec_messageEdit->toHtml(), true);
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ void fourn(double data[],unsigned long nn[],unsigned long ndim,int isign)
|
||||
double theta,wi,wpi,wpr,wr,wtemp;
|
||||
|
||||
ntot=1;
|
||||
for (idim=1;idim<=(long)ndim;idim++)
|
||||
for (idim=1;idim<=(long)ndim;++idim)
|
||||
ntot *= nn[idim];
|
||||
nprev=1;
|
||||
for (idim=ndim;idim>=1;idim--) {
|
||||
|
@ -289,7 +289,7 @@ void GxsChannelPostItem::loadPost(const RsGxsChannelPost &post)
|
||||
|
||||
if (mFileItems.empty() == false) {
|
||||
std::list<SubFileItem *>::iterator it;
|
||||
for(it = mFileItems.begin(); it != mFileItems.end(); it++)
|
||||
for(it = mFileItems.begin(); it != mFileItems.end(); ++it)
|
||||
{
|
||||
delete(*it);
|
||||
}
|
||||
@ -297,7 +297,7 @@ void GxsChannelPostItem::loadPost(const RsGxsChannelPost &post)
|
||||
}
|
||||
|
||||
std::list<RsGxsFile>::const_iterator it;
|
||||
for(it = post.mFiles.begin(); it != post.mFiles.end(); it++)
|
||||
for(it = post.mFiles.begin(); it != post.mFiles.end(); ++it)
|
||||
{
|
||||
/* add file */
|
||||
std::string path;
|
||||
@ -390,20 +390,20 @@ void GxsChannelPostItem::updateItem()
|
||||
|
||||
/* Very slow Tick to check when all files are downloaded */
|
||||
std::list<SubFileItem *>::iterator it;
|
||||
for(it = mFileItems.begin(); it != mFileItems.end(); it++)
|
||||
for(it = mFileItems.begin(); it != mFileItems.end(); ++it)
|
||||
{
|
||||
SubFileItem *item = *it;
|
||||
|
||||
if (item->isDownloadable(startable)) {
|
||||
downloadCount++;
|
||||
++downloadCount;
|
||||
if (startable) {
|
||||
downloadStartable++;
|
||||
++downloadStartable;
|
||||
}
|
||||
}
|
||||
if (item->isPlayable(startable)) {
|
||||
playCount++;
|
||||
++playCount;
|
||||
if (startable) {
|
||||
playStartable++;
|
||||
++playStartable;
|
||||
}
|
||||
}
|
||||
|
||||
@ -509,7 +509,7 @@ void GxsChannelPostItem::unsubscribeChannel()
|
||||
void GxsChannelPostItem::download()
|
||||
{
|
||||
std::list<SubFileItem *>::iterator it;
|
||||
for(it = mFileItems.begin(); it != mFileItems.end(); it++)
|
||||
for(it = mFileItems.begin(); it != mFileItems.end(); ++it)
|
||||
{
|
||||
(*it)->download();
|
||||
}
|
||||
@ -520,7 +520,7 @@ void GxsChannelPostItem::download()
|
||||
void GxsChannelPostItem::play()
|
||||
{
|
||||
std::list<SubFileItem *>::iterator it;
|
||||
for(it = mFileItems.begin(); it != mFileItems.end(); it++)
|
||||
for(it = mFileItems.begin(); it != mFileItems.end(); ++it)
|
||||
{
|
||||
bool startable;
|
||||
if ((*it)->isPlayable(startable) && startable) {
|
||||
|
@ -135,7 +135,7 @@ void MsgItem::updateItemStatic()
|
||||
msgLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mi.msg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
||||
|
||||
std::list<FileInfo>::iterator it;
|
||||
for(it = mi.files.begin(); it != mi.files.end(); it++)
|
||||
for(it = mi.files.begin(); it != mi.files.end(); ++it)
|
||||
{
|
||||
/* add file */
|
||||
SubFileItem *fi = new SubFileItem(it->hash, it->fname, it->path, it->size, SFI_STATE_REMOTE, mi.rspeerid_srcId);
|
||||
@ -177,7 +177,7 @@ void MsgItem::updateItem()
|
||||
|
||||
/* Very slow Tick to check when all files are downloaded */
|
||||
std::list<SubFileItem *>::iterator it;
|
||||
for(it = mFileItems.begin(); it != mFileItems.end(); it++)
|
||||
for(it = mFileItems.begin(); it != mFileItems.end(); ++it)
|
||||
{
|
||||
if (!(*it)->done())
|
||||
{
|
||||
|
@ -82,7 +82,7 @@ CreateGroup::CreateGroup(const std::string &groupId, QWidget *parent)
|
||||
rsPeers->getGroupInfoList(groupInfoList);
|
||||
|
||||
std::list<RsGroupInfo>::iterator groupIt;
|
||||
for (groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); groupIt++) {
|
||||
for (groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); ++groupIt) {
|
||||
if (mGroupId.empty() || groupIt->id != mGroupId) {
|
||||
mUsedGroupNames.append(GroupDefs::name(*groupIt));
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ void GxsCircleChooser::loadGxsCircles()
|
||||
std::list<RsGxsCircleId>::iterator it;
|
||||
int i = 0;
|
||||
int def = -1;
|
||||
for(it = ids.begin(); it != ids.end(); it++, i++)
|
||||
for(it = ids.begin(); it != ids.end(); ++it, ++i)
|
||||
{
|
||||
/* add to Chooser */
|
||||
QString str;
|
||||
|
@ -282,7 +282,7 @@ void GxsCommentTreeWidget::completeItems()
|
||||
std::cerr << " PendingItems";
|
||||
std::cerr << std::endl;
|
||||
|
||||
for(pit = mPendingInsertMap.begin(); pit != mPendingInsertMap.end(); pit++)
|
||||
for(pit = mPendingInsertMap.begin(); pit != mPendingInsertMap.end(); ++pit)
|
||||
{
|
||||
std::cerr << "GxsCommentTreeWidget::completeItems() item->parent: " << pit->first;
|
||||
std::cerr << std::endl;
|
||||
@ -408,7 +408,7 @@ void GxsCommentTreeWidget::service_loadThread(const uint32_t &token)
|
||||
|
||||
std::vector<RsGxsComment>::iterator vit;
|
||||
|
||||
for(vit = comments.begin(); vit != comments.end(); vit++)
|
||||
for(vit = comments.begin(); vit != comments.end(); ++vit)
|
||||
{
|
||||
RsGxsComment &comment = *vit;
|
||||
/* convert to a QTreeWidgetItem */
|
||||
|
@ -499,7 +499,7 @@ bool GxsGroupFrameDialog::navigate(const RsGxsGroupId groupId, const RsGxsMessag
|
||||
// QTreeWidgetItemIterator itemIterator(ui->threadTreeWidget);
|
||||
// QTreeWidgetItem *item = NULL;
|
||||
// while ((item = *itemIterator) != NULL) {
|
||||
// itemIterator++;
|
||||
// ++itemIterator;
|
||||
//
|
||||
// if (item->data(COLUMN_THREAD_DATA, ROLE_THREAD_MSGID).toString().toStdString() == msgId) {
|
||||
// ui->threadTreeWidget->setCurrentItem(item);
|
||||
@ -685,7 +685,7 @@ void GxsGroupFrameDialog::insertGroupsData(const std::list<RsGroupMetaData> &gro
|
||||
QList<GroupItemInfo> otherList;
|
||||
std::multimap<uint32_t, GroupItemInfo> popMap;
|
||||
|
||||
for (it = groupList.begin(); it != groupList.end(); it++) {
|
||||
for (it = groupList.begin(); it != groupList.end(); ++it) {
|
||||
/* sort it into Publish (Own), Subscribed, Popular and Other */
|
||||
uint32_t flags = it->mSubscribeFlags;
|
||||
|
||||
@ -721,12 +721,12 @@ void GxsGroupFrameDialog::insertGroupsData(const std::list<RsGroupMetaData> &gro
|
||||
uint32_t i = 0;
|
||||
uint32_t popLimit = 0;
|
||||
std::multimap<uint32_t, GroupItemInfo>::reverse_iterator rit;
|
||||
for(rit = popMap.rbegin(); ((rit != popMap.rend()) && (i < popCount)); rit++, i++) ;
|
||||
for(rit = popMap.rbegin(); ((rit != popMap.rend()) && (i < popCount)); ++rit, ++i) ;
|
||||
if (rit != popMap.rend()) {
|
||||
popLimit = rit->first;
|
||||
}
|
||||
|
||||
for (rit = popMap.rbegin(); rit != popMap.rend(); rit++) {
|
||||
for (rit = popMap.rbegin(); rit != popMap.rend(); ++rit) {
|
||||
if (rit->second.popularity < (int) popLimit) {
|
||||
otherList.append(rit->second);
|
||||
} else {
|
||||
@ -756,10 +756,10 @@ void GxsGroupFrameDialog::updateMessageSummaryList(RsGxsGroupId groupId)
|
||||
|
||||
if (groupId.isNull()) {
|
||||
QTreeWidgetItem *items[2] = { mYourGroups, mSubscribedGroups };
|
||||
for (int item = 0; item < 2; item++) {
|
||||
for (int item = 0; item < 2; ++item) {
|
||||
int child;
|
||||
int childCount = items[item]->childCount();
|
||||
for (child = 0; child < childCount; child++) {
|
||||
for (child = 0; child < childCount; ++child) {
|
||||
QTreeWidgetItem *childItem = items[item]->child(child);
|
||||
QString childId = ui->groupTreeWidget->itemId(childItem);
|
||||
if (childId.isEmpty()) {
|
||||
|
@ -211,7 +211,7 @@ void GxsIdChooser::loadPrivateIds(uint32_t token)
|
||||
}//if (mFirstLoad)
|
||||
|
||||
if (!mFirstLoad) {
|
||||
for (int idx=0; idx < count(); idx++) {
|
||||
for (int idx=0; idx < count(); ++idx) {
|
||||
QVariant type = itemData(idx,ROLE_TYPE);
|
||||
switch (type.toInt()) {
|
||||
case TYPE_NO_ID:
|
||||
@ -228,7 +228,7 @@ void GxsIdChooser::loadPrivateIds(uint32_t token)
|
||||
}//if (lit == ids.end())
|
||||
}//default:
|
||||
}//switch (type.toInt())
|
||||
}//for (int idx=0; idx < count(); idx++)
|
||||
}//for (int idx=0; idx < count(); ++idx)
|
||||
}//if (!mFirstLoad)
|
||||
|
||||
if (ids.empty()) {
|
||||
@ -238,7 +238,7 @@ void GxsIdChooser::loadPrivateIds(uint32_t token)
|
||||
return;
|
||||
}//if (ids.empty())
|
||||
|
||||
for(std::list<RsGxsId>::iterator it = ids.begin(); it != ids.end(); it++) {
|
||||
for(std::list<RsGxsId>::iterator it = ids.begin(); it != ids.end(); ++it) {
|
||||
/* add to Chooser */
|
||||
addPrivateId(*it, !mFirstLoad);
|
||||
}//for(std::list<RsGxsId>::iterator it
|
||||
|
@ -186,7 +186,7 @@ bool GxsIdDetails::MakeIdDesc(const RsGxsId &id, bool doIcons, QString &str, std
|
||||
str = QString::fromUtf8(details.mNickname.c_str());
|
||||
|
||||
std::list<RsRecognTag>::iterator it;
|
||||
for(it = details.mRecognTags.begin(); it != details.mRecognTags.end(); it++)
|
||||
for(it = details.mRecognTags.begin(); it != details.mRecognTags.end(); ++it)
|
||||
{
|
||||
str += " (";
|
||||
str += QString::number(it->tag_class);
|
||||
@ -240,7 +240,7 @@ bool GxsIdDetails::MakeIdDesc(const RsGxsId &id, bool doIcons, QString &str, std
|
||||
|
||||
icons.push_back(baseIcon);
|
||||
// Add In RecognTags Icons.
|
||||
for(it = details.mRecognTags.begin(); it != details.mRecognTags.end(); it++)
|
||||
for(it = details.mRecognTags.begin(); it != details.mRecognTags.end(); ++it)
|
||||
{
|
||||
QIcon tagIcon;
|
||||
if (findTagIcon(it->tag_class, it->tag_type, tagIcon))
|
||||
@ -270,7 +270,7 @@ bool GxsIdDetails::GenerateCombinedIcon(QIcon &outIcon, std::list<QIcon> &icons)
|
||||
painter.fillRect(0, 0, IconSize * count, IconSize, Qt::transparent);
|
||||
std::list<QIcon>::iterator it;
|
||||
int i = 0;
|
||||
for(it = icons.begin(); it != icons.end(); it++, i++)
|
||||
for(it = icons.begin(); it != icons.end(); ++it, ++i)
|
||||
{
|
||||
it->paint(&painter, IconSize * i, 0, IconSize, IconSize);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ static void paintGxsId( QPainter * painter,
|
||||
std::list<QIcon>::iterator it;
|
||||
const int IconSize = 15;
|
||||
int i = 0;
|
||||
for(it = icons.begin(); it != icons.end(); it++, i++)
|
||||
for(it = icons.begin(); it != icons.end(); ++it, ++i)
|
||||
{
|
||||
it->paint(painter, x, y, IconSize, IconSize);
|
||||
x += IconSize;
|
||||
|
@ -102,7 +102,7 @@ void CreateGxsChannelMsg::contextMenu(QPoint /*point*/)
|
||||
|
||||
for(QList<RetroShareLink>::const_iterator it(links.begin());it!=links.end();++it)
|
||||
if((*it).type() == RetroShareLink::TYPE_FILE)
|
||||
n_file++ ;
|
||||
++n_file ;
|
||||
|
||||
QMenu contextMnu(this) ;
|
||||
|
||||
@ -160,7 +160,7 @@ void CreateGxsChannelMsg::dragEnterEvent(QDragEnterEvent *event)
|
||||
std::cerr << std::endl;
|
||||
QStringList formats = event->mimeData()->formats();
|
||||
QStringList::iterator it;
|
||||
for(it = formats.begin(); it != formats.end(); it++)
|
||||
for(it = formats.begin(); it != formats.end(); ++it)
|
||||
{
|
||||
std::cerr << "Format: " << (*it).toStdString();
|
||||
std::cerr << std::endl;
|
||||
@ -205,7 +205,7 @@ void CreateGxsChannelMsg::dropEvent(QDropEvent *event)
|
||||
std::cerr << "CreateGxsChannelMsg::dropEvent() Formats" << std::endl;
|
||||
QStringList formats = event->mimeData()->formats();
|
||||
QStringList::iterator it;
|
||||
for(it = formats.begin(); it != formats.end(); it++)
|
||||
for(it = formats.begin(); it != formats.end(); ++it)
|
||||
{
|
||||
std::cerr << "Format: " << (*it).toStdString();
|
||||
std::cerr << std::endl;
|
||||
@ -225,7 +225,7 @@ void CreateGxsChannelMsg::dropEvent(QDropEvent *event)
|
||||
|
||||
QList<QUrl> urls = event->mimeData()->urls();
|
||||
QList<QUrl>::iterator uit;
|
||||
for(uit = urls.begin(); uit != urls.end(); uit++)
|
||||
for(uit = urls.begin(); uit != urls.end(); ++uit)
|
||||
{
|
||||
QString localpath = uit->toLocalFile();
|
||||
std::cerr << "Whole URL: " << uit->toString().toStdString() << std::endl;
|
||||
@ -277,7 +277,7 @@ void CreateGxsChannelMsg::parseRsFileListAttachments(const std::string &attachLi
|
||||
QStringList::iterator it;
|
||||
QStringList::iterator it2;
|
||||
|
||||
for(it = attachItems.begin(); it != attachItems.end(); it++)
|
||||
for(it = attachItems.begin(); it != attachItems.end(); ++it)
|
||||
{
|
||||
std::cerr << "CreateGxsChannelMsg::parseRsFileListAttachments() Entry: ";
|
||||
|
||||
@ -292,7 +292,7 @@ void CreateGxsChannelMsg::parseRsFileListAttachments(const std::string &attachLi
|
||||
RsPeerId source;
|
||||
|
||||
int i = 0;
|
||||
for(it2 = parts.begin(); it2 != parts.end(); it2++, i++)
|
||||
for(it2 = parts.begin(); it2 != parts.end(); ++it2, ++i)
|
||||
{
|
||||
std::cerr << "\"" << it2->toStdString() << "\" ";
|
||||
switch(i)
|
||||
@ -374,7 +374,7 @@ void CreateGxsChannelMsg::addExtraFile()
|
||||
|
||||
QStringList files;
|
||||
if (misc::getOpenFileNames(this, RshareSettings::LASTDIR_EXTRAFILE, tr("Add Extra File"), "", files)) {
|
||||
for (QStringList::iterator fileIt = files.begin(); fileIt != files.end(); fileIt++) {
|
||||
for (QStringList::iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
|
||||
addAttachment((*fileIt).toUtf8().constData());
|
||||
}
|
||||
}
|
||||
@ -395,7 +395,7 @@ void CreateGxsChannelMsg::addAttachment(const std::string &path)
|
||||
// check attachment if hash exists already
|
||||
std::list<SubFileItem* >::iterator it;
|
||||
|
||||
for(it= mAttachments.begin(); it != mAttachments.end(); it++){
|
||||
for(it= mAttachments.begin(); it != mAttachments.end(); ++it){
|
||||
|
||||
if((*it)->FilePath() == path){
|
||||
QMessageBox::warning(this, tr("RetroShare"), tr("File already Added and Hashed"), QMessageBox::Ok, QMessageBox::Ok);
|
||||
@ -489,7 +489,7 @@ void CreateGxsChannelMsg::checkAttachmentReady()
|
||||
|
||||
mCheckAttachment = false;
|
||||
|
||||
for(fit = mAttachments.begin(); fit != mAttachments.end(); fit++)
|
||||
for(fit = mAttachments.begin(); fit != mAttachments.end(); ++fit)
|
||||
{
|
||||
if (!(*fit)->isHidden())
|
||||
{
|
||||
@ -526,7 +526,7 @@ void CreateGxsChannelMsg::cancelMsg()
|
||||
|
||||
std::list<SubFileItem* >::const_iterator it;
|
||||
|
||||
for(it = mAttachments.begin(); it != mAttachments.end(); it++)
|
||||
for(it = mAttachments.begin(); it != mAttachments.end(); ++it)
|
||||
rsGxsChannels->ExtraFileRemove((*it)->FileHash());
|
||||
|
||||
reject();
|
||||
@ -577,7 +577,7 @@ void CreateGxsChannelMsg::sendMsg()
|
||||
|
||||
std::list<SubFileItem *>::iterator fit;
|
||||
|
||||
for(fit = mAttachments.begin(); fit != mAttachments.end(); fit++)
|
||||
for(fit = mAttachments.begin(); fit != mAttachments.end(); ++fit)
|
||||
{
|
||||
if (!(*fit)->isHidden())
|
||||
{
|
||||
|
@ -370,7 +370,7 @@ void GxsChannelPostsWidget::insertChannelPosts(std::vector<RsGxsChannelPost> &po
|
||||
ui->feedWidget->setSortingEnabled(false);
|
||||
}
|
||||
|
||||
for (it = posts.begin(); it != posts.end(); it++)
|
||||
for (it = posts.begin(); it != posts.end(); ++it)
|
||||
{
|
||||
if (thread && thread->stopped()) {
|
||||
break;
|
||||
|
@ -379,17 +379,17 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/)
|
||||
QList<QTreeWidgetItem*> rowsUnread;
|
||||
int nCount = getSelectedMsgCount(&rows, &rowsRead, &rowsUnread);
|
||||
|
||||
if (rowsUnread.size() == 0) {
|
||||
if (rowsUnread.isEmpty()) {
|
||||
markMsgAsRead->setDisabled(true);
|
||||
}
|
||||
if (rowsRead.size() == 0) {
|
||||
if (rowsRead.isEmpty()) {
|
||||
markMsgAsUnread->setDisabled(true);
|
||||
}
|
||||
|
||||
bool hasUnreadChildren = false;
|
||||
bool hasReadChildren = false;
|
||||
int rowCount = rows.count();
|
||||
for (int i = 0; i < rowCount; i++) {
|
||||
for (int i = 0; i < rowCount; ++i) {
|
||||
if (hasUnreadChildren || rows[i]->data(COLUMN_THREAD_DATA, ROLE_THREAD_UNREADCHILDREN).toBool()) {
|
||||
hasUnreadChildren = true;
|
||||
}
|
||||
@ -523,7 +523,7 @@ void GxsForumThreadWidget::forumMsgReadStatusChanged(const QString &forumId, con
|
||||
QTreeWidgetItemIterator itemIterator(ui->threadTreeWidget);
|
||||
QTreeWidgetItem *item = NULL;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
if (item->data(COLUMN_THREAD_DATA, ROLE_THREAD_MSGID).toString() == msgId) {
|
||||
// update status
|
||||
@ -616,7 +616,7 @@ void GxsForumThreadWidget::calculateUnreadCount()
|
||||
QTreeWidgetItemIterator itemIterator(ui->threadTreeWidget);
|
||||
QTreeWidgetItem *item = NULL;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
uint32_t status = item->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt();
|
||||
if (IS_MSG_UNREAD(status)) {
|
||||
@ -665,7 +665,7 @@ void GxsForumThreadWidget::calculateIconsAndFonts(QTreeWidgetItem *item /*= NULL
|
||||
static void cleanupItems (QList<QTreeWidgetItem *> &items)
|
||||
{
|
||||
QList<QTreeWidgetItem *>::iterator item;
|
||||
for (item = items.begin (); item != items.end (); item++) {
|
||||
for (item = items.begin (); item != items.end (); ++item) {
|
||||
if (*item) {
|
||||
delete (*item);
|
||||
}
|
||||
@ -727,7 +727,7 @@ void GxsForumThreadWidget::fillThreadFinished()
|
||||
QTreeWidgetItemIterator itemIterator(ui->threadTreeWidget);
|
||||
QTreeWidgetItem *item = NULL;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
if (item->data(COLUMN_THREAD_DATA, ROLE_THREAD_MSGID).toString().toStdString() == thread->mFocusMsgId) {
|
||||
ui->threadTreeWidget->setCurrentItem(item);
|
||||
@ -1003,7 +1003,7 @@ void GxsForumThreadWidget::fillThreads(QList<QTreeWidgetItem *> &threadList, boo
|
||||
}
|
||||
}
|
||||
if (found >= 0) {
|
||||
index++;
|
||||
++index;
|
||||
} else {
|
||||
delete(ui->threadTreeWidget->takeTopLevelItem(index));
|
||||
}
|
||||
@ -1083,7 +1083,7 @@ void GxsForumThreadWidget::fillChildren(QTreeWidgetItem *parentItem, QTreeWidget
|
||||
}
|
||||
}
|
||||
if (found >= 0) {
|
||||
index++;
|
||||
++index;
|
||||
} else {
|
||||
delete(parentItem->takeChild (index));
|
||||
}
|
||||
@ -1312,7 +1312,7 @@ void GxsForumThreadWidget::nextUnreadMessage()
|
||||
|
||||
QTreeWidgetItem *item;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
if (item == currentItem) {
|
||||
continue;
|
||||
@ -1360,7 +1360,7 @@ int GxsForumThreadWidget::getSelectedMsgCount(QList<QTreeWidgetItem*> *rows, QLi
|
||||
if (rowsUnread) rowsUnread->clear();
|
||||
|
||||
QList<QTreeWidgetItem*> selectedItems = ui->threadTreeWidget->selectedItems();
|
||||
for(QList<QTreeWidgetItem*>::iterator it = selectedItems.begin(); it != selectedItems.end(); it++) {
|
||||
for(QList<QTreeWidgetItem*>::iterator it = selectedItems.begin(); it != selectedItems.end(); ++it) {
|
||||
if (rows) rows->append(*it);
|
||||
if (rowsRead || rowsUnread) {
|
||||
uint32_t status = (*it)->data(COLUMN_THREAD_DATA, ROLE_THREAD_STATUS).toUInt();
|
||||
@ -1423,7 +1423,7 @@ void GxsForumThreadWidget::setMsgReadStatus(QList<QTreeWidgetItem*> &rows, bool
|
||||
mInMsgAsReadUnread = false;
|
||||
|
||||
if (changedItems.size()) {
|
||||
for (std::list<QTreeWidgetItem*>::iterator it = changedItems.begin(); it != changedItems.end(); it++) {
|
||||
for (std::list<QTreeWidgetItem*>::iterator it = changedItems.begin(); it != changedItems.end(); ++it) {
|
||||
calculateIconsAndFonts(*it);
|
||||
}
|
||||
//#TODO updateMessageSummaryList(mForumId);
|
||||
@ -1441,7 +1441,7 @@ void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool f
|
||||
QList<QTreeWidgetItem*> rows;
|
||||
if (forum) {
|
||||
int itemCount = ui->threadTreeWidget->topLevelItemCount();
|
||||
for (int item = 0; item < itemCount; item++) {
|
||||
for (int item = 0; item < itemCount; ++item) {
|
||||
rows.push_back(ui->threadTreeWidget->topLevelItem(item));
|
||||
}
|
||||
} else {
|
||||
@ -1462,7 +1462,7 @@ void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool f
|
||||
allRows.append(row);
|
||||
}
|
||||
|
||||
for (int i = 0; i < row->childCount(); i++) {
|
||||
for (int i = 0; i < row->childCount(); ++i) {
|
||||
/* add child to main list and let the main loop do the work */
|
||||
rows.append(row->child(i));
|
||||
}
|
||||
@ -1680,7 +1680,7 @@ bool GxsForumThreadWidget::filterItem(QTreeWidgetItem *item, const QString &text
|
||||
int count = item->childCount();
|
||||
for (int nIndex = 0; nIndex < count; ++nIndex) {
|
||||
if (filterItem(item->child(nIndex), text, filterColumn)) {
|
||||
visibleChildCount++;
|
||||
++visibleChildCount;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ GxsForumsFillThread::~GxsForumsFillThread()
|
||||
|
||||
// remove all items (when items are available, the thread was terminated)
|
||||
QList<QTreeWidgetItem *>::iterator item;
|
||||
for (item = mItems.begin (); item != mItems.end (); item++) {
|
||||
for (item = mItems.begin (); item != mItems.end (); ++item) {
|
||||
if (*item) {
|
||||
delete (*item);
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ ImHistoryBrowserCreateItemsThread::~ImHistoryBrowserCreateItemsThread()
|
||||
{
|
||||
// remove all items (when items are available, the thread was terminated)
|
||||
QList<QListWidgetItem*>::iterator it;
|
||||
for (it = m_items.begin(); it != m_items.end(); it++) {
|
||||
for (it = m_items.begin(); it != m_items.end(); ++it) {
|
||||
delete(*it);
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ void ImHistoryBrowserCreateItemsThread::run()
|
||||
int current = 0;
|
||||
|
||||
std::list<HistoryMsg>::iterator it;
|
||||
for (it = historyMsgs.begin(); it != historyMsgs.end(); it++) {
|
||||
for (it = historyMsgs.begin(); it != historyMsgs.end(); ++it) {
|
||||
if (stopped) {
|
||||
break;
|
||||
}
|
||||
@ -162,7 +162,7 @@ void ImHistoryBrowser::createThreadFinished()
|
||||
if (!m_createThread->wasStopped()) {
|
||||
// append created items
|
||||
QList<QListWidgetItem*>::iterator it;
|
||||
for (it = m_createThread->m_items.begin(); it != m_createThread->m_items.end(); it++) {
|
||||
for (it = m_createThread->m_items.begin(); it != m_createThread->m_items.end(); ++it) {
|
||||
ui.listWidget->addItem(*it);
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ void ImHistoryBrowser::createThreadFinished()
|
||||
m_createThread = NULL;
|
||||
|
||||
QList<HistoryMsg>::iterator histIt;
|
||||
for (histIt = itemsAddedOnLoad.begin(); histIt != itemsAddedOnLoad.end(); histIt++) {
|
||||
for (histIt = itemsAddedOnLoad.begin(); histIt != itemsAddedOnLoad.end(); ++histIt) {
|
||||
historyAdd(*histIt);
|
||||
}
|
||||
itemsAddedOnLoad.clear();
|
||||
@ -241,7 +241,7 @@ void ImHistoryBrowser::historyChanged(uint msgId, int type)
|
||||
if (type == NOTIFY_TYPE_DEL) {
|
||||
/* history message removed */
|
||||
int count = ui.listWidget->count();
|
||||
for (int i = 0; i < count; i++) {
|
||||
for (int i = 0; i < count; ++i) {
|
||||
QListWidgetItem *itemWidget = ui.listWidget->item(i);
|
||||
if (itemWidget->data(ROLE_MSGID).toString().toUInt() == msgId) {
|
||||
delete(ui.listWidget->takeItem(i));
|
||||
@ -302,7 +302,7 @@ void ImHistoryBrowser::filterItems(const QString &text, QListWidgetItem *item)
|
||||
{
|
||||
if (item == NULL) {
|
||||
int count = ui.listWidget->count();
|
||||
for (int i = 0; i < count; i++) {
|
||||
for (int i = 0; i < count; ++i) {
|
||||
item = ui.listWidget->item(i);
|
||||
if (text.isEmpty()) {
|
||||
item->setHidden(false);
|
||||
@ -332,7 +332,7 @@ void ImHistoryBrowser::getSelectedItems(std::list<uint32_t> &items)
|
||||
QList<QListWidgetItem*> itemWidgets = ui.listWidget->selectedItems();
|
||||
|
||||
QList<QListWidgetItem*>::iterator it;
|
||||
for (it = itemWidgets.begin(); it != itemWidgets.end(); it++) {
|
||||
for (it = itemWidgets.begin(); it != itemWidgets.end(); ++it) {
|
||||
QListWidgetItem *item = *it;
|
||||
if (item->isHidden()) {
|
||||
continue;
|
||||
|
@ -433,7 +433,7 @@ static QString buildRecommendHtml(const std::list<RsPeerId> &sslIds, const RsPee
|
||||
|
||||
/* process ssl ids */
|
||||
std::list <RsPeerId>::const_iterator sslIt;
|
||||
for (sslIt = sslIds.begin(); sslIt != sslIds.end(); sslIt++) {
|
||||
for (sslIt = sslIds.begin(); sslIt != sslIds.end(); ++sslIt) {
|
||||
if (*sslIt == excludeId) {
|
||||
continue;
|
||||
}
|
||||
@ -455,7 +455,7 @@ void MessageComposer::recommendFriend(const std::list <RsPeerId> &sslIds, const
|
||||
{
|
||||
// std::cerr << "MessageComposer::recommendFriend()" << std::endl;
|
||||
|
||||
if (sslIds.size() == 0) {
|
||||
if (sslIds.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -486,7 +486,7 @@ void MessageComposer::recommendFriend(const std::list <RsPeerId> &sslIds, const
|
||||
composer->setMsgText(sMsgText);
|
||||
|
||||
std::list <RsPeerId>::const_iterator peerIt;
|
||||
for (peerIt = sslIds.begin(); peerIt != sslIds.end(); peerIt++) {
|
||||
for (peerIt = sslIds.begin(); peerIt != sslIds.end(); ++peerIt) {
|
||||
if (*peerIt == to) {
|
||||
continue;
|
||||
}
|
||||
@ -523,7 +523,7 @@ void MessageComposer::sendConnectAttemptMsg(const RsPgpId &gpgId, const RsPeerId
|
||||
std::list<MsgInfoSummary>::const_iterator it;
|
||||
|
||||
rsMsgs->getMessageSummaries(msgList);
|
||||
for(it = msgList.begin(); it != msgList.end(); it++) {
|
||||
for(it = msgList.begin(); it != msgList.end(); ++it) {
|
||||
if (it->msgflags & RS_MSG_TRASH) {
|
||||
continue;
|
||||
}
|
||||
@ -620,7 +620,7 @@ void MessageComposer::pasteRecommended()
|
||||
QList<RetroShareLink> links;
|
||||
RSLinkClipboard::pasteLinks(links);
|
||||
|
||||
for (int i = 0; i < links.size(); i++) {
|
||||
for (int i = 0; i < links.size(); ++i) {
|
||||
if (links[i].valid() && links[i].type() == RetroShareLink::TYPE_FILE) {
|
||||
FileInfo fileInfo;
|
||||
fileInfo.fname = links[i].name().toStdString();
|
||||
@ -637,7 +637,7 @@ static void setNewCompleter(QTableWidget *tableWidget, QCompleter *completer)
|
||||
int rowCount = tableWidget->rowCount();
|
||||
int row;
|
||||
|
||||
for (row = 0; row < rowCount; row++) {
|
||||
for (row = 0; row < rowCount; ++row) {
|
||||
QLineEdit *lineEdit = dynamic_cast<QLineEdit*>(tableWidget->cellWidget(row, COLUMN_RECIPIENT_NAME));
|
||||
if (lineEdit) {
|
||||
lineEdit->setCompleter(completer);
|
||||
@ -660,7 +660,7 @@ void MessageComposer::buildCompleter()
|
||||
QStringList completerList;
|
||||
QStringList completerGroupList;
|
||||
|
||||
for (peerIt = peers.begin(); peerIt != peers.end(); peerIt++) {
|
||||
for (peerIt = peers.begin(); peerIt != peers.end(); ++peerIt) {
|
||||
RsPeerDetails detail;
|
||||
if (!rsPeers->getPeerDetails(*peerIt, detail)) {
|
||||
continue; /* BAD */
|
||||
@ -675,7 +675,7 @@ void MessageComposer::buildCompleter()
|
||||
completerList.sort();
|
||||
|
||||
// create completer list for groups
|
||||
for (groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); groupIt++) {
|
||||
for (groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); ++groupIt) {
|
||||
completerGroupList.append(GroupDefs::name(*groupIt));
|
||||
}
|
||||
|
||||
@ -692,7 +692,7 @@ void MessageComposer::peerStatusChanged(const QString& peer_id, int status)
|
||||
int rowCount = ui.recipientWidget->rowCount();
|
||||
int row;
|
||||
|
||||
for (row = 0; row < rowCount; row++) {
|
||||
for (row = 0; row < rowCount; ++row) {
|
||||
enumType type;
|
||||
destinationType dtype ;
|
||||
std::string id;
|
||||
@ -714,7 +714,7 @@ void MessageComposer::setFileList(const std::list<DirDetails>& dir_info)
|
||||
std::list<DirDetails>::const_iterator it;
|
||||
|
||||
/* convert dir_info to files_info */
|
||||
for(it = dir_info.begin(); it != dir_info.end(); it++)
|
||||
for(it = dir_info.begin(); it != dir_info.end(); ++it)
|
||||
{
|
||||
FileInfo info ;
|
||||
info.fname = it->name ;
|
||||
@ -733,7 +733,7 @@ void MessageComposer::setFileList(const std::list<FileInfo>& files_info)
|
||||
ui.msgFileList->clear();
|
||||
|
||||
std::list<FileInfo>::const_iterator it;
|
||||
for(it = files_info.begin(); it != files_info.end(); it++) {
|
||||
for(it = files_info.begin(); it != files_info.end(); ++it) {
|
||||
addFile(*it);
|
||||
}
|
||||
|
||||
@ -742,7 +742,7 @@ void MessageComposer::setFileList(const std::list<FileInfo>& files_info)
|
||||
|
||||
void MessageComposer::addFile(const FileInfo &fileInfo)
|
||||
{
|
||||
for(std::list<FileInfo>::iterator it = _recList.begin(); it != _recList.end(); it++) {
|
||||
for(std::list<FileInfo>::iterator it = _recList.begin(); it != _recList.end(); ++it) {
|
||||
if (it->hash == fileInfo.hash) {
|
||||
/* File already added */
|
||||
return;
|
||||
@ -792,14 +792,14 @@ static void calculateGroupsOfSslIds(const std::list<RsGroupInfo> &existingGroupI
|
||||
|
||||
// iterate all groups
|
||||
std::list<RsGroupInfo>::const_iterator groupInfoIt;
|
||||
for (groupInfoIt = existingGroupInfos.begin(); groupInfoIt != existingGroupInfos.end(); groupInfoIt++) {
|
||||
for (groupInfoIt = existingGroupInfos.begin(); groupInfoIt != existingGroupInfos.end(); ++groupInfoIt) {
|
||||
if (groupInfoIt->peerIds.empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// iterate all assigned peers (gpg id's)
|
||||
std::list<RsPgpId>::const_iterator peerIt;
|
||||
for (peerIt = groupInfoIt->peerIds.begin(); peerIt != groupInfoIt->peerIds.end(); peerIt++) {
|
||||
for (peerIt = groupInfoIt->peerIds.begin(); peerIt != groupInfoIt->peerIds.end(); ++peerIt) {
|
||||
std::list<RsPeerId> sslIds;
|
||||
|
||||
std::map<RsPgpId, std::list<RsPeerId> >::const_iterator it = gpgToSslIds.find(*peerIt);
|
||||
@ -813,7 +813,7 @@ static void calculateGroupsOfSslIds(const std::list<RsGroupInfo> &existingGroupI
|
||||
|
||||
// iterate all ssl id's
|
||||
std::list<RsPeerId>::const_iterator sslIt;
|
||||
for (sslIt = sslIds.begin(); sslIt != sslIds.end(); sslIt++) {
|
||||
for (sslIt = sslIds.begin(); sslIt != sslIds.end(); ++sslIt) {
|
||||
// search in ssl list
|
||||
if (std::find(checkSslIds.begin(), checkSslIds.end(), *sslIt) == checkSslIds.end()) {
|
||||
// not found
|
||||
@ -833,10 +833,10 @@ static void calculateGroupsOfSslIds(const std::list<RsGroupInfo> &existingGroupI
|
||||
}
|
||||
|
||||
// remove all ssl id's of all found groups from the list
|
||||
for (groupInfoIt = groupInfos.begin(); groupInfoIt != groupInfos.end(); groupInfoIt++) {
|
||||
for (groupInfoIt = groupInfos.begin(); groupInfoIt != groupInfos.end(); ++groupInfoIt) {
|
||||
// iterate all assigned peers (gpg id's)
|
||||
std::list<RsPgpId>::const_iterator peerIt;
|
||||
for (peerIt = groupInfoIt->peerIds.begin(); peerIt != groupInfoIt->peerIds.end(); peerIt++) {
|
||||
for (peerIt = groupInfoIt->peerIds.begin(); peerIt != groupInfoIt->peerIds.end(); ++peerIt) {
|
||||
std::list<RsPeerId> sslIds;
|
||||
|
||||
std::map<RsPgpId, std::list<RsPeerId> >::iterator it = gpgToSslIds.find(*peerIt);
|
||||
@ -850,7 +850,7 @@ static void calculateGroupsOfSslIds(const std::list<RsGroupInfo> &existingGroupI
|
||||
|
||||
// iterate all ssl id's
|
||||
std::list<RsPeerId>::const_iterator sslIt;
|
||||
for (sslIt = sslIds.begin(); sslIt != sslIds.end(); sslIt++) {
|
||||
for (sslIt = sslIds.begin(); sslIt != sslIds.end(); ++sslIt) {
|
||||
// search in ssl list
|
||||
std::list<RsPeerId>::iterator it = std::find(checkSslIds.begin(), checkSslIds.end(), *sslIt);
|
||||
if (it != checkSslIds.end()) {
|
||||
@ -905,26 +905,26 @@ MessageComposer *MessageComposer::newMsg(const std::string &msgId /* = ""*/)
|
||||
std::list<std::string>::iterator groupIt;
|
||||
|
||||
// calculateGroupsOfSslIds(groupInfoList, msgInfo.msgto, groupIds);
|
||||
// for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) {
|
||||
// for (groupIt = groupIds.begin(); groupIt != groupIds.end(); ++groupIt ) {
|
||||
// msgComposer->addRecipient(MessageComposer::TO, *groupIt, true) ;
|
||||
// }
|
||||
|
||||
// calculateGroupsOfSslIds(groupInfoList, msgInfo.msgcc, groupIds);
|
||||
// for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) {
|
||||
// for (groupIt = groupIds.begin(); groupIt != groupIds.end(); ++groupIt ) {
|
||||
// msgComposer->addRecipient(MessageComposer::CC, *groupIt, true) ;
|
||||
// }
|
||||
|
||||
// calculateGroupsOfSslIds(groupInfoList, msgInfo.msgbcc, groupIds);
|
||||
// for (groupIt = groupIds.begin(); groupIt != groupIds.end(); groupIt++ ) {
|
||||
// for (groupIt = groupIds.begin(); groupIt != groupIds.end(); ++groupIt ) {
|
||||
// msgComposer->addRecipient(MessageComposer::BCC, *groupIt, true) ;
|
||||
// }
|
||||
|
||||
for (std::list<RsPeerId>::const_iterator it = msgInfo.rspeerid_msgto.begin(); it != msgInfo.rspeerid_msgto.end(); it++ ) msgComposer->addRecipient(MessageComposer::TO, *it) ;
|
||||
for (std::list<RsPeerId>::const_iterator it = msgInfo.rspeerid_msgcc.begin(); it != msgInfo.rspeerid_msgcc.end(); it++ ) msgComposer->addRecipient(MessageComposer::CC, *it) ;
|
||||
for (std::list<RsPeerId>::const_iterator it = msgInfo.rspeerid_msgbcc.begin(); it != msgInfo.rspeerid_msgbcc.end(); it++ ) msgComposer->addRecipient(MessageComposer::BCC, *it) ;
|
||||
for (std::list<RsGxsId>::const_iterator it = msgInfo.rsgxsid_msgto.begin(); it != msgInfo.rsgxsid_msgto.end(); it++ ) msgComposer->addRecipient(MessageComposer::TO, *it) ;
|
||||
for (std::list<RsGxsId>::const_iterator it = msgInfo.rsgxsid_msgcc.begin(); it != msgInfo.rsgxsid_msgcc.end(); it++ ) msgComposer->addRecipient(MessageComposer::CC, *it) ;
|
||||
for (std::list<RsGxsId>::const_iterator it = msgInfo.rsgxsid_msgbcc.begin(); it != msgInfo.rsgxsid_msgbcc.end(); it++ ) msgComposer->addRecipient(MessageComposer::BCC, *it) ;
|
||||
for (std::list<RsPeerId>::const_iterator it = msgInfo.rspeerid_msgto.begin(); it != msgInfo.rspeerid_msgto.end(); ++it ) msgComposer->addRecipient(MessageComposer::TO, *it) ;
|
||||
for (std::list<RsPeerId>::const_iterator it = msgInfo.rspeerid_msgcc.begin(); it != msgInfo.rspeerid_msgcc.end(); ++it ) msgComposer->addRecipient(MessageComposer::CC, *it) ;
|
||||
for (std::list<RsPeerId>::const_iterator it = msgInfo.rspeerid_msgbcc.begin(); it != msgInfo.rspeerid_msgbcc.end(); ++it ) msgComposer->addRecipient(MessageComposer::BCC, *it) ;
|
||||
for (std::list<RsGxsId>::const_iterator it = msgInfo.rsgxsid_msgto.begin(); it != msgInfo.rsgxsid_msgto.end(); ++it ) msgComposer->addRecipient(MessageComposer::TO, *it) ;
|
||||
for (std::list<RsGxsId>::const_iterator it = msgInfo.rsgxsid_msgcc.begin(); it != msgInfo.rsgxsid_msgcc.end(); ++it ) msgComposer->addRecipient(MessageComposer::CC, *it) ;
|
||||
for (std::list<RsGxsId>::const_iterator it = msgInfo.rsgxsid_msgbcc.begin(); it != msgInfo.rsgxsid_msgbcc.end(); ++it ) msgComposer->addRecipient(MessageComposer::BCC, *it) ;
|
||||
|
||||
MsgTagInfo tagInfo;
|
||||
rsMsgs->getMessageTag(msgId, tagInfo);
|
||||
@ -946,7 +946,7 @@ QString MessageComposer::buildReplyHeader(const MessageInfo &msgInfo)
|
||||
QString from = link.toHtml();
|
||||
|
||||
QString to;
|
||||
for ( std::list<RsPeerId>::const_iterator it = msgInfo.rspeerid_msgto.begin(); it != msgInfo.rspeerid_msgto.end(); it++)
|
||||
for ( std::list<RsPeerId>::const_iterator it = msgInfo.rspeerid_msgto.begin(); it != msgInfo.rspeerid_msgto.end(); ++it)
|
||||
if (link.createMessage(*it, ""))
|
||||
{
|
||||
if (!to.isEmpty())
|
||||
@ -954,7 +954,7 @@ QString MessageComposer::buildReplyHeader(const MessageInfo &msgInfo)
|
||||
|
||||
to += link.toHtml();
|
||||
}
|
||||
for ( std::list<RsGxsId>::const_iterator it = msgInfo.rsgxsid_msgto.begin(); it != msgInfo.rsgxsid_msgto.end(); it++)
|
||||
for ( std::list<RsGxsId>::const_iterator it = msgInfo.rsgxsid_msgto.begin(); it != msgInfo.rsgxsid_msgto.end(); ++it)
|
||||
if (link.createMessage(*it, ""))
|
||||
{
|
||||
if (!to.isEmpty())
|
||||
@ -965,14 +965,14 @@ QString MessageComposer::buildReplyHeader(const MessageInfo &msgInfo)
|
||||
|
||||
|
||||
QString cc;
|
||||
for (std::list<RsPeerId>::const_iterator it = msgInfo.rspeerid_msgcc.begin(); it != msgInfo.rspeerid_msgcc.end(); it++)
|
||||
for (std::list<RsPeerId>::const_iterator it = msgInfo.rspeerid_msgcc.begin(); it != msgInfo.rspeerid_msgcc.end(); ++it)
|
||||
if (link.createMessage(*it, "")) {
|
||||
if (!cc.isEmpty()) {
|
||||
cc += ", ";
|
||||
}
|
||||
cc += link.toHtml();
|
||||
}
|
||||
for (std::list<RsGxsId>::const_iterator it = msgInfo.rsgxsid_msgcc.begin(); it != msgInfo.rsgxsid_msgcc.end(); it++)
|
||||
for (std::list<RsGxsId>::const_iterator it = msgInfo.rsgxsid_msgcc.begin(); it != msgInfo.rsgxsid_msgcc.end(); ++it)
|
||||
if (link.createMessage(*it, "")) {
|
||||
if (!cc.isEmpty()) {
|
||||
cc += ", ";
|
||||
@ -1059,19 +1059,19 @@ MessageComposer *MessageComposer::replyMsg(const std::string &msgId, bool all)
|
||||
{
|
||||
RsPeerId ownId = rsPeers->getOwnId();
|
||||
|
||||
for (std::list<RsPeerId>::iterator tli = msgInfo.rspeerid_msgto.begin(); tli != msgInfo.rspeerid_msgto.end(); tli++)
|
||||
for (std::list<RsPeerId>::iterator tli = msgInfo.rspeerid_msgto.begin(); tli != msgInfo.rspeerid_msgto.end(); ++tli)
|
||||
if (ownId != *tli)
|
||||
msgComposer->addRecipient(MessageComposer::TO, *tli) ;
|
||||
|
||||
for (std::list<RsPeerId>::iterator tli = msgInfo.rspeerid_msgcc.begin(); tli != msgInfo.rspeerid_msgcc.end(); tli++)
|
||||
for (std::list<RsPeerId>::iterator tli = msgInfo.rspeerid_msgcc.begin(); tli != msgInfo.rspeerid_msgcc.end(); ++tli)
|
||||
if (ownId != *tli)
|
||||
msgComposer->addRecipient(MessageComposer::TO, *tli) ;
|
||||
|
||||
for (std::list<RsGxsId>::iterator tli = msgInfo.rsgxsid_msgto.begin(); tli != msgInfo.rsgxsid_msgto.end(); tli++)
|
||||
for (std::list<RsGxsId>::iterator tli = msgInfo.rsgxsid_msgto.begin(); tli != msgInfo.rsgxsid_msgto.end(); ++tli)
|
||||
//if (ownId != *tli)
|
||||
msgComposer->addRecipient(MessageComposer::TO, *tli) ;
|
||||
|
||||
for (std::list<RsGxsId>::iterator tli = msgInfo.rsgxsid_msgcc.begin(); tli != msgInfo.rsgxsid_msgcc.end(); tli++)
|
||||
for (std::list<RsGxsId>::iterator tli = msgInfo.rsgxsid_msgcc.begin(); tli != msgInfo.rsgxsid_msgcc.end(); ++tli)
|
||||
//if (ownId != *tli)
|
||||
msgComposer->addRecipient(MessageComposer::TO, *tli) ;
|
||||
}
|
||||
@ -1197,11 +1197,11 @@ bool MessageComposer::sendMessage_internal(bool bDraftbox)
|
||||
}
|
||||
|
||||
int filesCount = ui.msgFileList->topLevelItemCount();
|
||||
for (int i = 0; i < filesCount; i++) {
|
||||
for (int i = 0; i < filesCount; ++i) {
|
||||
QTreeWidgetItem *item = ui.msgFileList->topLevelItem(i);
|
||||
if (item->checkState(COLUMN_FILE_CHECKED)) {
|
||||
RsFileHash hash ( item->text(COLUMN_FILE_HASH).toStdString() );
|
||||
for(std::list<FileInfo>::iterator it = _recList.begin(); it != _recList.end(); it++) {
|
||||
for(std::list<FileInfo>::iterator it = _recList.begin(); it != _recList.end(); ++it) {
|
||||
if (it->hash == hash) {
|
||||
mi.files.push_back(*it);
|
||||
break;
|
||||
@ -1220,7 +1220,7 @@ bool MessageComposer::sendMessage_internal(bool bDraftbox)
|
||||
int rowCount = ui.recipientWidget->rowCount();
|
||||
int row;
|
||||
|
||||
for (row = 0; row < rowCount; row++)
|
||||
for (row = 0; row < rowCount; ++row)
|
||||
{
|
||||
enumType type;
|
||||
destinationType dtype ;
|
||||
@ -1239,12 +1239,12 @@ bool MessageComposer::sendMessage_internal(bool bDraftbox)
|
||||
}
|
||||
|
||||
std::list<RsPgpId>::const_iterator groupIt;
|
||||
for (groupIt = groupInfo.peerIds.begin(); groupIt != groupInfo.peerIds.end(); groupIt++) {
|
||||
for (groupIt = groupInfo.peerIds.begin(); groupIt != groupInfo.peerIds.end(); ++groupIt) {
|
||||
std::list<RsPeerId> sslIds;
|
||||
rsPeers->getAssociatedSSLIds(*groupIt, sslIds);
|
||||
|
||||
std::list<RsPeerId>::const_iterator sslIt;
|
||||
for (sslIt = sslIds.begin(); sslIt != sslIds.end(); sslIt++) {
|
||||
for (sslIt = sslIds.begin(); sslIt != sslIds.end(); ++sslIt) {
|
||||
if (std::find(peers.begin(), peers.end(), *sslIt) == peers.end()) {
|
||||
// no friend
|
||||
continue;
|
||||
@ -1356,7 +1356,7 @@ bool MessageComposer::sendMessage_internal(bool bDraftbox)
|
||||
|
||||
/* insert new tags */
|
||||
std::list<uint32_t>::iterator tag;
|
||||
for (tag = m_tagIds.begin(); tag != m_tagIds.end(); tag++) {
|
||||
for (tag = m_tagIds.begin(); tag != m_tagIds.end(); ++tag) {
|
||||
if (std::find(tagInfo.tagIds.begin(), tagInfo.tagIds.end(), *tag) == tagInfo.tagIds.end()) {
|
||||
rsMsgs->setMessageTag(mi.msgId, *tag, true);
|
||||
} else {
|
||||
@ -1365,7 +1365,7 @@ bool MessageComposer::sendMessage_internal(bool bDraftbox)
|
||||
}
|
||||
|
||||
/* remove deleted tags */
|
||||
for (tag = tagInfo.tagIds.begin(); tag != tagInfo.tagIds.end(); tag++) {
|
||||
for (tag = tagInfo.tagIds.begin(); tag != tagInfo.tagIds.end(); ++tag) {
|
||||
rsMsgs->setMessageTag(mi.msgId, *tag, false);
|
||||
}
|
||||
}
|
||||
@ -1531,7 +1531,7 @@ bool MessageComposer::eventFilter(QObject *obj, QEvent *event)
|
||||
if (lineEdit) {
|
||||
int rowCount = ui.recipientWidget->rowCount();
|
||||
int row;
|
||||
for (row = 0; row < rowCount; row++) {
|
||||
for (row = 0; row < rowCount; ++row) {
|
||||
if (ui.recipientWidget->cellWidget(row, COLUMN_RECIPIENT_NAME) == lineEdit) {
|
||||
break;
|
||||
}
|
||||
@ -1545,7 +1545,7 @@ bool MessageComposer::eventFilter(QObject *obj, QEvent *event)
|
||||
if (comboBox) {
|
||||
int rowCount = ui.recipientWidget->rowCount();
|
||||
int row;
|
||||
for (row = 0; row < rowCount; row++) {
|
||||
for (row = 0; row < rowCount; ++row) {
|
||||
if (ui.recipientWidget->cellWidget(row, COLUMN_RECIPIENT_TYPE) == comboBox) {
|
||||
break;
|
||||
}
|
||||
@ -1574,7 +1574,7 @@ void MessageComposer::editingRecipientFinished()
|
||||
// find row of the widget
|
||||
int rowCount = ui.recipientWidget->rowCount();
|
||||
int row;
|
||||
for (row = 0; row < rowCount; row++) {
|
||||
for (row = 0; row < rowCount; ++row) {
|
||||
if (ui.recipientWidget->cellWidget(row, COLUMN_RECIPIENT_NAME) == lineEdit) {
|
||||
break;
|
||||
}
|
||||
@ -1602,7 +1602,7 @@ void MessageComposer::editingRecipientFinished()
|
||||
rsPeers->getFriendList(peers);
|
||||
|
||||
std::list<RsPeerId>::iterator peerIt;
|
||||
for (peerIt = peers.begin(); peerIt != peers.end(); peerIt++) {
|
||||
for (peerIt = peers.begin(); peerIt != peers.end(); ++peerIt) {
|
||||
RsPeerDetails details;
|
||||
if (!rsPeers->getPeerDetails(*peerIt, details)) {
|
||||
continue; /* BAD */
|
||||
@ -1621,7 +1621,7 @@ void MessageComposer::editingRecipientFinished()
|
||||
rsPeers->getGroupInfoList(groupInfoList);
|
||||
|
||||
std::list<RsGroupInfo>::iterator groupIt;
|
||||
for (groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); groupIt++) {
|
||||
for (groupIt = groupInfoList.begin(); groupIt != groupInfoList.end(); ++groupIt) {
|
||||
QString groupName = GroupDefs::name(*groupIt);
|
||||
if (text.compare(groupName, Qt::CaseSensitive) == 0) {
|
||||
// found it
|
||||
@ -1638,7 +1638,7 @@ void MessageComposer::addRecipient(enumType type, const RsPeerId& pid)
|
||||
{
|
||||
int rowCount = ui.recipientWidget->rowCount();
|
||||
int row;
|
||||
for (row = 0; row < rowCount; row++)
|
||||
for (row = 0; row < rowCount; ++row)
|
||||
{
|
||||
enumType rowType;
|
||||
std::string rowId;
|
||||
@ -1664,7 +1664,7 @@ void MessageComposer::addRecipient(enumType type, const RsGxsId& gxs_id)
|
||||
|
||||
int rowCount = ui.recipientWidget->rowCount();
|
||||
int row;
|
||||
for (row = 0; row < rowCount; row++)
|
||||
for (row = 0; row < rowCount; ++row)
|
||||
{
|
||||
enumType rowType;
|
||||
std::string rowId;
|
||||
@ -1690,7 +1690,7 @@ void MessageComposer::addRecipient(enumType type, const std::string& id)
|
||||
// search existing or empty row
|
||||
int rowCount = ui.recipientWidget->rowCount();
|
||||
int row;
|
||||
for (row = 0; row < rowCount; row++) {
|
||||
for (row = 0; row < rowCount; ++row) {
|
||||
enumType rowType;
|
||||
std::string rowId;
|
||||
destinationType dtype ;
|
||||
@ -2352,19 +2352,19 @@ void MessageComposer::addContact(enumType type)
|
||||
// ui.friendSelectionWidget->selectedIds<std::string,FriendSelectionWidget::IDTYPE_GROUP>(ids,false);
|
||||
//
|
||||
// std::list<std::string>::iterator idIt;
|
||||
// for (idIt = ids.begin(); idIt != ids.end(); idIt++) {
|
||||
// for (idIt = ids.begin(); idIt != ids.end(); ++idIt) {
|
||||
// addRecipient(type, *idIt, true);
|
||||
// }
|
||||
|
||||
std::list<RsPeerId> ids ;
|
||||
ui.friendSelectionWidget->selectedIds<RsPeerId,FriendSelectionWidget::IDTYPE_SSL>(ids, true);
|
||||
for (std::list<RsPeerId>::const_iterator idIt = ids.begin(); idIt != ids.end(); idIt++) {
|
||||
for (std::list<RsPeerId>::const_iterator idIt = ids.begin(); idIt != ids.end(); ++idIt) {
|
||||
addRecipient(type, *idIt);
|
||||
}
|
||||
|
||||
std::list<RsGxsId> id2 ;
|
||||
ui.friendSelectionWidget->selectedIds<RsGxsId,FriendSelectionWidget::IDTYPE_GXS>(id2, true);
|
||||
for (std::list<RsGxsId>::const_iterator idIt = id2.begin(); idIt != id2.end(); idIt++)
|
||||
for (std::list<RsGxsId>::const_iterator idIt = id2.begin(); idIt != id2.end(); ++idIt)
|
||||
addRecipient(type, *idIt);
|
||||
}
|
||||
|
||||
@ -2403,9 +2403,9 @@ void MessageComposer::addRecommend()
|
||||
if (sslIds.empty() && gxsIds.empty())
|
||||
return;
|
||||
|
||||
for(std::list <RsPeerId>::iterator it = sslIds.begin(); it != sslIds.end(); it++)
|
||||
for(std::list <RsPeerId>::iterator it = sslIds.begin(); it != sslIds.end(); ++it)
|
||||
addRecipient(CC, *it);
|
||||
for (std::list<RsGxsId>::const_iterator it = gxsIds.begin(); it != gxsIds.end(); it++)
|
||||
for (std::list<RsGxsId>::const_iterator it = gxsIds.begin(); it != gxsIds.end(); ++it)
|
||||
addRecipient(TO, *it);
|
||||
|
||||
QString text = buildRecommendHtml(sslIds);
|
||||
@ -2485,7 +2485,7 @@ void MessageComposer::showTagLabels()
|
||||
rsMsgs->getMessageTagTypes(tags);
|
||||
|
||||
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator tag;
|
||||
for (std::list<uint32_t>::iterator tagId = m_tagIds.begin(); tagId != m_tagIds.end(); tagId++) {
|
||||
for (std::list<uint32_t>::iterator tagId = m_tagIds.begin(); tagId != m_tagIds.end(); ++tagId) {
|
||||
tag = tags.types.find(*tagId);
|
||||
if (tag != tags.types.end()) {
|
||||
QLabel *tagLabel = new QLabel(TagDefs::name(tag->first, tag->second.first), this);
|
||||
|
@ -350,7 +350,7 @@ void MessageWidget::getallrecommended()
|
||||
std::list<FileInfo>::const_iterator it;
|
||||
|
||||
/* do the requests */
|
||||
for(it = recList.begin(); it != recList.end(); it++) {
|
||||
for(it = recList.begin(); it != recList.end(); ++it) {
|
||||
std::cerr << "MessageWidget::getallrecommended() Calling File Request" << std::endl;
|
||||
std::list<RsPeerId> srcIds;
|
||||
srcIds.push_back(msgInfo.rspeerid_srcId);
|
||||
@ -414,7 +414,7 @@ void MessageWidget::showTagLabels()
|
||||
rsMsgs->getMessageTagTypes(Tags);
|
||||
|
||||
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator Tag;
|
||||
for (std::list<uint32_t>::iterator tagId = tagInfo.tagIds.begin(); tagId != tagInfo.tagIds.end(); tagId++) {
|
||||
for (std::list<uint32_t>::iterator tagId = tagInfo.tagIds.begin(); tagId != tagInfo.tagIds.end(); ++tagId) {
|
||||
Tag = Tags.types.find(*tagId);
|
||||
if (Tag != Tags.types.end()) {
|
||||
QLabel *tagLabel = new QLabel(TagDefs::name(Tag->first, Tag->second.first), this);
|
||||
@ -490,7 +490,7 @@ void MessageWidget::fill(const std::string &msgId)
|
||||
ui.msgList->clear();
|
||||
|
||||
QList<QTreeWidgetItem*> items;
|
||||
for (it = recList.begin(); it != recList.end(); it++) {
|
||||
for (it = recList.begin(); it != recList.end(); ++it) {
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem;
|
||||
item->setText(COLUMN_FILE_NAME, QString::fromUtf8(it->fname.c_str()));
|
||||
item->setText(COLUMN_FILE_SIZE, QString::number(it->size));
|
||||
@ -507,8 +507,8 @@ void MessageWidget::fill(const std::string &msgId)
|
||||
RetroShareLink link;
|
||||
QString text;
|
||||
|
||||
for(std::list<RsPeerId>::const_iterator pit = msgInfo.rspeerid_msgto.begin(); pit != msgInfo.rspeerid_msgto.end(); pit++) if (link.createMessage(*pit, "")) text += link.toHtml() + " ";
|
||||
for(std::list<RsGxsId >::const_iterator pit = msgInfo.rsgxsid_msgto.begin(); pit != msgInfo.rsgxsid_msgto.end(); pit++) if (link.createMessage(*pit, "")) text += link.toHtml() + " ";
|
||||
for(std::list<RsPeerId>::const_iterator pit = msgInfo.rspeerid_msgto.begin(); pit != msgInfo.rspeerid_msgto.end(); ++pit) if (link.createMessage(*pit, "")) text += link.toHtml() + " ";
|
||||
for(std::list<RsGxsId >::const_iterator pit = msgInfo.rsgxsid_msgto.begin(); pit != msgInfo.rsgxsid_msgto.end(); ++pit) if (link.createMessage(*pit, "")) text += link.toHtml() + " ";
|
||||
|
||||
ui.toText->setText(text);
|
||||
|
||||
@ -518,8 +518,8 @@ void MessageWidget::fill(const std::string &msgId)
|
||||
ui.ccText->setVisible(true);
|
||||
|
||||
text.clear();
|
||||
for(std::list<RsPeerId>::const_iterator pit = msgInfo.rspeerid_msgcc.begin(); pit != msgInfo.rspeerid_msgcc.end(); pit++) if (link.createMessage(*pit, "")) text += link.toHtml() + " ";
|
||||
for(std::list<RsGxsId>::const_iterator pit = msgInfo.rsgxsid_msgcc.begin(); pit != msgInfo.rsgxsid_msgcc.end(); pit++) if (link.createMessage(*pit, "")) text += link.toHtml() + " ";
|
||||
for(std::list<RsPeerId>::const_iterator pit = msgInfo.rspeerid_msgcc.begin(); pit != msgInfo.rspeerid_msgcc.end(); ++pit) if (link.createMessage(*pit, "")) text += link.toHtml() + " ";
|
||||
for(std::list<RsGxsId>::const_iterator pit = msgInfo.rsgxsid_msgcc.begin(); pit != msgInfo.rsgxsid_msgcc.end(); ++pit) if (link.createMessage(*pit, "")) text += link.toHtml() + " ";
|
||||
|
||||
ui.ccText->setText(text);
|
||||
} else {
|
||||
@ -534,8 +534,8 @@ void MessageWidget::fill(const std::string &msgId)
|
||||
ui.bccText->setVisible(true);
|
||||
|
||||
text.clear();
|
||||
for(std::list<RsPeerId>::const_iterator pit = msgInfo.rspeerid_msgbcc.begin(); pit != msgInfo.rspeerid_msgbcc.end(); pit++) if (link.createMessage(*pit, "")) text += link.toHtml() + " ";
|
||||
for(std::list<RsGxsId>::const_iterator pit = msgInfo.rsgxsid_msgbcc.begin(); pit != msgInfo.rsgxsid_msgbcc.end(); pit++) if (link.createMessage(*pit, "")) text += link.toHtml() + " ";
|
||||
for(std::list<RsPeerId>::const_iterator pit = msgInfo.rspeerid_msgbcc.begin(); pit != msgInfo.rspeerid_msgbcc.end(); ++pit) if (link.createMessage(*pit, "")) text += link.toHtml() + " ";
|
||||
for(std::list<RsGxsId>::const_iterator pit = msgInfo.rsgxsid_msgbcc.begin(); pit != msgInfo.rsgxsid_msgbcc.end(); ++pit) if (link.createMessage(*pit, "")) text += link.toHtml() + " ";
|
||||
|
||||
ui.bccText->setText(text);
|
||||
} else {
|
||||
|
@ -112,7 +112,7 @@ void TagsMenu::fillTags()
|
||||
|
||||
addSeparator();
|
||||
|
||||
for (tag = tags.types.begin(); tag != tags.types.end(); tag++) {
|
||||
for (tag = tags.types.begin(); tag != tags.types.end(); ++tag) {
|
||||
text = TagDefs::name(tag->first, tag->second.first);
|
||||
|
||||
action = new QAction(text, this);
|
||||
|
@ -95,7 +95,7 @@ void ProfileManager::fillIdentities()
|
||||
std::list<RsPgpId>::iterator it;
|
||||
|
||||
if (RsAccounts::GetPGPLogins(pgpIds)) {
|
||||
for (it = pgpIds.begin(); it != pgpIds.end(); it++) {
|
||||
for (it = pgpIds.begin(); it != pgpIds.end(); ++it) {
|
||||
std::string name, email;
|
||||
RsAccounts::GetPGPLoginDetails(*it, name, email);
|
||||
std::cerr << "Adding PGPUser: " << name << " id: " << *it << std::endl;
|
||||
|
@ -68,7 +68,7 @@ static QString loadStyleInfo(ChatStyle::enumStyleType type, QListWidget *listWid
|
||||
}
|
||||
|
||||
ChatStyle::getAvailableStyles(type, styles);
|
||||
for (style = styles.begin(); style != styles.end(); style++) {
|
||||
for (style = styles.begin(); style != styles.end(); ++style) {
|
||||
item = new QListWidgetItem(style->styleName);
|
||||
item->setData(Qt::UserRole, qVariantFromValue(*style));
|
||||
listWidget->addItem(item);
|
||||
|
@ -149,7 +149,7 @@ FileAssociationsPage::save (QString &/*errmsg*/)
|
||||
// {
|
||||
// settings.setValue( ati.key(), ati.value() );
|
||||
// qDebug() << " - " << ati.key() << ati.value() << "\n" ;
|
||||
// ati++;
|
||||
// ++ati;
|
||||
// }
|
||||
//
|
||||
// settings.endGroup();
|
||||
@ -173,14 +173,14 @@ FileAssociationsPage::load()
|
||||
|
||||
int rowi = 0;
|
||||
QStringList::const_iterator ki;
|
||||
for(ki=keys.constBegin(); ki!=keys.constEnd(); ki++)
|
||||
for(ki=keys.constBegin(); ki!=keys.constEnd(); ++ki)
|
||||
{
|
||||
QString val = (Settings->value(*ki, "")).toString();
|
||||
|
||||
addNewItemToTable( rowi, 0, *ki );
|
||||
addNewItemToTable( rowi, 1, val );
|
||||
|
||||
rowi++;
|
||||
++rowi;
|
||||
}
|
||||
|
||||
if (keys.count()==0)
|
||||
@ -237,7 +237,7 @@ FileAssociationsPage::addnew()
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int rowi=0; rowi<table->rowCount(); rowi++)
|
||||
for(int rowi=0; rowi<table->rowCount(); ++rowi)
|
||||
{
|
||||
titem = table->item( rowi, 0);
|
||||
if (titem->data(QTableWidgetItem::Type).toString()==currType)
|
||||
|
@ -71,10 +71,10 @@ MessagePage::save(QString &/*errmsg*/)
|
||||
Settings->setMsgOpen((RshareSettings::enumMsgOpen) ui.openComboBox->itemData(ui.openComboBox->currentIndex()).toInt());
|
||||
|
||||
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator Tag;
|
||||
for (Tag = m_pTags->types.begin(); Tag != m_pTags->types.end(); Tag++) {
|
||||
for (Tag = m_pTags->types.begin(); Tag != m_pTags->types.end(); ++Tag) {
|
||||
// check for changed tags
|
||||
std::list<uint32_t>::iterator changedTagId;
|
||||
for (changedTagId = m_changedTagIds.begin(); changedTagId != m_changedTagIds.end(); changedTagId++) {
|
||||
for (changedTagId = m_changedTagIds.begin(); changedTagId != m_changedTagIds.end(); ++changedTagId) {
|
||||
if (*changedTagId == Tag->first) {
|
||||
if (Tag->second.first.empty()) {
|
||||
// delete tag
|
||||
@ -111,7 +111,7 @@ void MessagePage::fillTags()
|
||||
ui.tags_listWidget->clear();
|
||||
|
||||
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator Tag;
|
||||
for (Tag = m_pTags->types.begin(); Tag != m_pTags->types.end(); Tag++) {
|
||||
for (Tag = m_pTags->types.begin(); Tag != m_pTags->types.end(); ++Tag) {
|
||||
QString text = TagDefs::name(Tag->first, Tag->second.first);
|
||||
|
||||
QListWidgetItem *pItemWidget = new QListWidgetItem(text, ui.tags_listWidget);
|
||||
@ -206,7 +206,7 @@ void MessagePage::defaultTag()
|
||||
|
||||
// add all standard items to changed list
|
||||
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator Tag;
|
||||
for (Tag = m_pTags->types.begin(); Tag != m_pTags->types.end(); Tag++) {
|
||||
for (Tag = m_pTags->types.begin(); Tag != m_pTags->types.end(); ++Tag) {
|
||||
if (Tag->first < RS_MSGTAGTYPE_USER) {
|
||||
if (std::find(m_changedTagIds.begin(), m_changedTagIds.end(), Tag->first) == m_changedTagIds.end()) {
|
||||
m_changedTagIds.push_back(Tag->first);
|
||||
|
@ -70,7 +70,7 @@ void NewTag::OnOK()
|
||||
// calculate new id
|
||||
m_nId = RS_MSGTAGTYPE_USER;
|
||||
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator Tag;
|
||||
for (Tag = m_Tags.types.begin(); Tag != m_Tags.types.end(); Tag++) {
|
||||
for (Tag = m_Tags.types.begin(); Tag != m_Tags.types.end(); ++Tag) {
|
||||
if (Tag->first + 1 > m_nId) {
|
||||
m_nId = Tag->first + 1;
|
||||
}
|
||||
@ -100,7 +100,7 @@ void NewTag::textChanged(const QString &text)
|
||||
} else {
|
||||
// check for existing text
|
||||
std::map<uint32_t, std::pair<std::string, uint32_t> >::iterator Tag;
|
||||
for (Tag = m_Tags.types.begin(); Tag != m_Tags.types.end(); Tag++) {
|
||||
for (Tag = m_Tags.types.begin(); Tag != m_Tags.types.end(); ++Tag) {
|
||||
if (m_nId && Tag->first == m_nId) {
|
||||
// its me
|
||||
continue;
|
||||
|
@ -254,7 +254,7 @@ void NotifyPage::load()
|
||||
|
||||
QMap<int, QString>::iterator it;
|
||||
int index = 0;
|
||||
for (it = toasterPositions.begin(); it != toasterPositions.end(); it++, index++) {
|
||||
for (it = toasterPositions.begin(); it != toasterPositions.end(); ++it, ++index) {
|
||||
ui.comboBoxToasterPosition->addItem(it.value(), it.key());
|
||||
|
||||
if (it.key() == toasterPosition) {
|
||||
|
@ -166,7 +166,7 @@ void RelayPage::loadServers()
|
||||
rsDht->getRelayServerList(servers);
|
||||
|
||||
ui.serverTreeWidget->clear();
|
||||
for(it = servers.begin(); it != servers.end(); it++)
|
||||
for(it = servers.begin(); it != servers.end(); ++it)
|
||||
{
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem();
|
||||
item->setData(0, Qt::DisplayRole, QString::fromStdString(*it));
|
||||
|
@ -72,7 +72,7 @@ void RsharePeerSettings::cleanDeadIds()
|
||||
if (lastClean.addDays(DAYS_TO_CLEAN) < currentDate) {
|
||||
/* clean */
|
||||
QStringList groups = childGroups();
|
||||
for (QStringList::iterator group = groups.begin(); group != groups.end(); group++) {
|
||||
for (QStringList::iterator group = groups.begin(); group != groups.end(); ++group) {
|
||||
if (*group == GROUP_GENERAL) {
|
||||
continue;
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ void ServicePermissionsPage::load()
|
||||
QStringList columnHeaders;
|
||||
QStringList rowHeaders;
|
||||
columnHeaders.push_back(tr("Default"));
|
||||
for(pit = peerList.begin(); pit != peerList.end(); pit++)
|
||||
for(pit = peerList.begin(); pit != peerList.end(); ++pit)
|
||||
{
|
||||
columnHeaders.push_back(QString::fromStdString( rsPeers->getPeerName(*pit)));
|
||||
}
|
||||
@ -199,7 +199,7 @@ void ServicePermissionsPage::load()
|
||||
// Fill in CheckBoxes.
|
||||
size_t row;
|
||||
size_t column;
|
||||
for(row = 0, sit = ownServices.mServiceList.begin(); sit != ownServices.mServiceList.end(); sit++, row++)
|
||||
for(row = 0, sit = ownServices.mServiceList.begin(); sit != ownServices.mServiceList.end(); ++sit, ++row)
|
||||
{
|
||||
rowHeaders.push_back(QString::fromStdString(sit->second.mServiceName));
|
||||
RsServicePermissions permissions;
|
||||
@ -229,7 +229,7 @@ void ServicePermissionsPage::load()
|
||||
}
|
||||
|
||||
for(column = 1, pit = peerList.begin();
|
||||
pit != peerList.end(); pit++, column++)
|
||||
pit != peerList.end(); ++pit, ++column)
|
||||
{
|
||||
QTableWidgetItem *item = new QTableWidgetItem();
|
||||
Qt::ItemFlags flags(Qt::ItemIsUserCheckable);
|
||||
@ -264,7 +264,7 @@ void ServicePermissionsPage::load()
|
||||
// Now Get a List of Services Provided by Peers - and add text.
|
||||
int maxRowCount = mStdRowCount;
|
||||
for(column = 1, pit = peerList.begin();
|
||||
pit != peerList.end(); pit++, column++)
|
||||
pit != peerList.end(); ++pit, ++column)
|
||||
{
|
||||
RsPeerServiceInfo peerInfo;
|
||||
if (rsServiceControl->getServicesProvided(*pit, peerInfo))
|
||||
@ -354,7 +354,7 @@ void ServicePermissionsPage::load()
|
||||
}
|
||||
else
|
||||
{
|
||||
for(row = 0; row < mStdRowCount; row++)
|
||||
for(row = 0; row < mStdRowCount; ++row)
|
||||
{
|
||||
QTableWidgetItem *item = ui.tableWidget->item(row, column);
|
||||
item->setText(tr("N/A"));
|
||||
@ -380,7 +380,7 @@ void ServicePermissionsPage::tableItemChanged ( QTableWidgetItem * item )
|
||||
/* update the row */
|
||||
bool defaultOn = (Qt::Checked == item->checkState());
|
||||
item->setBackground(getColor(defaultOn, Qt::PartiallyChecked));
|
||||
for(int column = 1; column < ui.tableWidget->columnCount(); column++)
|
||||
for(int column = 1; column < ui.tableWidget->columnCount(); ++column)
|
||||
{
|
||||
QTableWidgetItem *rowitem = ui.tableWidget->item (item->row(), column);
|
||||
if (rowitem)
|
||||
|
@ -109,7 +109,7 @@ bool SoundPage::save(QString &/*errmsg*/)
|
||||
QTreeWidgetItemIterator itemIterator(ui.eventTreeWidget);
|
||||
QTreeWidgetItem *item = NULL;
|
||||
while ((item = *itemIterator) != NULL) {
|
||||
itemIterator++;
|
||||
++itemIterator;
|
||||
|
||||
if (item->type() == TYPE_ITEM) {
|
||||
const QString event = item->data(COLUMN_DATA, ROLE_EVENT).toString();
|
||||
|
@ -245,14 +245,14 @@ void BwCtrlWindow::updateBandwidth()
|
||||
item -> setData(COLUMN_OUT_ALLOC_SENT, Qt::DisplayRole, std::numeric_limits<qint64>::max());
|
||||
|
||||
time_t now = time(NULL);
|
||||
for(it = rateMap.begin(); it != rateMap.end(); it++)
|
||||
for(it = rateMap.begin(); it != rateMap.end(); ++it)
|
||||
{
|
||||
/* find the entry */
|
||||
QTreeWidgetItem *peer_item = NULL;
|
||||
#if 0
|
||||
QString qpeerid = QString::fromStdString(*it);
|
||||
int itemCount = peerTreeWidget->topLevelItemCount();
|
||||
for (int nIndex = 0; nIndex < itemCount; nIndex++)
|
||||
for (int nIndex = 0; nIndex < itemCount; ++nIndex)
|
||||
{
|
||||
QTreeWidgetItem *tmp_item = peerTreeWidget->topLevelItem(nIndex);
|
||||
if (tmp_item->data(COLUMN_PEERID, Qt::DisplayRole).toString() == qpeerid)
|
||||
|
@ -291,20 +291,20 @@ void DhtWindow::updateNetPeers()
|
||||
}
|
||||
else
|
||||
{
|
||||
nIndex++;
|
||||
++nIndex;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
ui.peerTreeWidget->clear();
|
||||
|
||||
for(it = peerIds.begin(); it != peerIds.end(); it++)
|
||||
for(it = peerIds.begin(); it != peerIds.end(); ++it)
|
||||
{
|
||||
/* find the entry */
|
||||
QTreeWidgetItem *peer_item = NULL;
|
||||
#if 0
|
||||
QString qpeerid = QString::fromStdString(*it);
|
||||
int itemCount = ui.peerTreeWidget->topLevelItemCount();
|
||||
for (int nIndex = 0; nIndex < itemCount; nIndex++)
|
||||
for (int nIndex = 0; nIndex < itemCount; ++nIndex)
|
||||
{
|
||||
QTreeWidgetItem *tmp_item = ui.peerTreeWidget->topLevelItem(nIndex);
|
||||
if (tmp_item->data(PTW_COL_PEERID, Qt::DisplayRole).toString() == qpeerid)
|
||||
@ -352,15 +352,15 @@ void DhtWindow::updateNetPeers()
|
||||
break;
|
||||
case RSDHT_PEERDHT_OFFLINE:
|
||||
dhtstate = tr("offline");
|
||||
nOfflinePeers++;
|
||||
++nOfflinePeers;
|
||||
break;
|
||||
case RSDHT_PEERDHT_UNREACHABLE:
|
||||
dhtstate = tr("Unreachable");
|
||||
nUnreachablePeers++;
|
||||
++nUnreachablePeers;
|
||||
break;
|
||||
case RSDHT_PEERDHT_ONLINE:
|
||||
dhtstate = tr("ONLINE");
|
||||
nOnlinePeers++;
|
||||
++nOnlinePeers;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -392,7 +392,7 @@ void DhtWindow::updateNetPeers()
|
||||
default:
|
||||
case RSDHT_PEERCONN_DISCONNECTED:
|
||||
cpsstr = tr("Disconnected");
|
||||
nDisconnPeers++;
|
||||
++nDisconnPeers;
|
||||
break;
|
||||
case RSDHT_PEERCONN_UDP_STARTED:
|
||||
cpsstr = tr("Udp Started");
|
||||
@ -405,13 +405,13 @@ void DhtWindow::updateNetPeers()
|
||||
{
|
||||
default:
|
||||
case RSDHT_TOU_MODE_DIRECT:
|
||||
nDirectPeers++;
|
||||
++nDirectPeers;
|
||||
break;
|
||||
case RSDHT_TOU_MODE_PROXY:
|
||||
nProxyPeers++;
|
||||
++nProxyPeers;
|
||||
break;
|
||||
case RSDHT_TOU_MODE_RELAY:
|
||||
nRelayPeers++;
|
||||
++nRelayPeers;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -508,7 +508,7 @@ void DhtWindow::updateRelays()
|
||||
relayTreeWidget->clear();
|
||||
time_t now = time(NULL);
|
||||
|
||||
for(reit = relayEnds.begin(); reit != relayEnds.end(); reit++)
|
||||
for(reit = relayEnds.begin(); reit != relayEnds.end(); ++reit)
|
||||
{
|
||||
/* find the entry */
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem();
|
||||
@ -538,7 +538,7 @@ void DhtWindow::updateRelays()
|
||||
}
|
||||
|
||||
|
||||
for(rpit = relayProxies.begin(); rpit != relayProxies.end(); rpit++)
|
||||
for(rpit = relayProxies.begin(); rpit != relayProxies.end(); ++rpit)
|
||||
{
|
||||
/* find the entry */
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem();
|
||||
@ -607,12 +607,12 @@ void DhtWindow::updateDhtPeers()
|
||||
std::list<RsDhtPeer> allpeers;
|
||||
std::list<RsDhtPeer>::iterator it;
|
||||
int i;
|
||||
for(i = 0; i < 160; i++)
|
||||
for(i = 0; i < 160; ++i)
|
||||
{
|
||||
std::list<RsDhtPeer> peers;
|
||||
rsDht->getDhtPeers(i, peers);
|
||||
|
||||
for(it = peers.begin(); it != peers.end(); it++)
|
||||
for(it = peers.begin(); it != peers.end(); ++it)
|
||||
{
|
||||
allpeers.push_back(*it);
|
||||
}
|
||||
@ -623,7 +623,7 @@ void DhtWindow::updateDhtPeers()
|
||||
ui.dhtTreeWidget->clear();
|
||||
|
||||
time_t now = time(NULL);
|
||||
for(it = allpeers.begin(); it != allpeers.end(); it++)
|
||||
for(it = allpeers.begin(); it != allpeers.end(); ++it)
|
||||
{
|
||||
/* find the entry */
|
||||
QTreeWidgetItem *dht_item = NULL;
|
||||
|
@ -84,13 +84,13 @@ class TRHistogram
|
||||
|
||||
if(_infos[i].age < h.size())
|
||||
{
|
||||
h[_infos[i].age]++ ;
|
||||
++h[_infos[i].age] ;
|
||||
if(h[_infos[i].age] > max_hits)
|
||||
max_hits = h[_infos[i].age] ;
|
||||
}
|
||||
if(_infos[i].depth < g.size())
|
||||
{
|
||||
g[_infos[i].depth]++ ;
|
||||
++g[_infos[i].depth] ;
|
||||
|
||||
if(g[_infos[i].depth] > max_depth)
|
||||
max_depth = g[_infos[i].depth] ;
|
||||
@ -133,7 +133,7 @@ class TRHistogram
|
||||
|
||||
for(int i=0;i<MaxTime;i+=5)
|
||||
painter->drawText(ox+i*cellx,oy+(p+1)*celly+4,QString::number(i)) ;
|
||||
for(int i=0;i<MaxDepth;i++)
|
||||
for(int i=0;i<MaxDepth;++i)
|
||||
painter->drawText(ox+MaxTime*cellx+20+i*cellx,oy+(p+1)*celly+4,QString::number(i)) ;
|
||||
painter->setPen(QColor::fromRgb(255,130,80)) ;
|
||||
painter->drawText(ox+MaxDepth*cellx+30+(MaxTime+1)*cellx+120,oy+(p+1)*celly+4,"("+QString::number(great_total)+")");
|
||||
|
@ -61,7 +61,7 @@ QString RSStyle::getStyleSheet() const
|
||||
|
||||
if (sheet.isEmpty() == false) {
|
||||
/* Replace colors */
|
||||
for (int i = 0; i < colors.size(); i++) {
|
||||
for (int i = 0; i < colors.size(); ++i) {
|
||||
sheet.replace(QString("<color%1>").arg(i + 1), colors[i].name());
|
||||
}
|
||||
}
|
||||
@ -93,7 +93,7 @@ void RSStyle::readSetting (QSettings &settings)
|
||||
colors.empty();
|
||||
|
||||
int size = settings.beginReadArray("colors");
|
||||
for (int i = 0; i < size; i++) {
|
||||
for (int i = 0; i < size; ++i) {
|
||||
settings.setArrayIndex(i);
|
||||
colors.append(QColor(settings.value("value").toString()));
|
||||
}
|
||||
@ -106,7 +106,7 @@ void RSStyle::writeSetting (QSettings &settings)
|
||||
|
||||
settings.beginWriteArray("colors");
|
||||
int size = colors.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
for (int i = 0; i < size; ++i) {
|
||||
settings.setArrayIndex(i);
|
||||
settings.setValue("value", colors[i].name());
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ StyleDialog::StyleDialog(RSStyle &style, QWidget *parent)
|
||||
showButtons();
|
||||
|
||||
/* Init colors */
|
||||
for (int i = 0; i < pushButtons.size(); i++) {
|
||||
for (int i = 0; i < pushButtons.size(); ++i) {
|
||||
if (i < style.colors.size()) {
|
||||
colors[pushButtons[i]] = style.colors[i];
|
||||
} else {
|
||||
@ -99,7 +99,7 @@ void StyleDialog::getStyle(RSStyle &style)
|
||||
style.colors.clear();
|
||||
|
||||
int count = qMin(neededColors(), pushButtons.size());
|
||||
for (int i = 0; i < count; i++) {
|
||||
for (int i = 0; i < count; ++i) {
|
||||
style.colors.append(colors[pushButtons[i]]);
|
||||
}
|
||||
}
|
||||
@ -107,7 +107,7 @@ void StyleDialog::getStyle(RSStyle &style)
|
||||
void StyleDialog::showButtons()
|
||||
{
|
||||
int count = neededColors();
|
||||
for (int i = 0; i < pushButtons.size(); i++) {
|
||||
for (int i = 0; i < pushButtons.size(); ++i) {
|
||||
pushButtons[i]->setVisible(i < count);
|
||||
labels[i]->setVisible(i < count);
|
||||
}
|
||||
@ -120,7 +120,7 @@ void StyleDialog::drawButtons()
|
||||
QPixmap pxm(16,14);
|
||||
|
||||
QMap<QPushButton*, QColor>::iterator it;
|
||||
for (it = colors.begin(); it != colors.end(); it++) {
|
||||
for (it = colors.begin(); it != colors.end(); ++it) {
|
||||
pxm.fill(it.value());
|
||||
it.key()->setIcon(pxm);
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ pascal void IdlePlatform::Private::IdleTimerAction(EventLoopTimerRef, EventLoopI
|
||||
break;
|
||||
case kEventLoopIdleTimerIdling:
|
||||
// Called every time the timer fires (i.e. every second).
|
||||
((IdlePlatform::Private*)inUserData)->mSecondsIdle++;
|
||||
++((IdlePlatform::Private*)inUserData)->mSecondsIdle;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ Rshare::parseArguments(QStringList args)
|
||||
QString arg, value;
|
||||
|
||||
/* Loop through all command-line args/values and put them in a map */
|
||||
for (int i = 0; i < args.size(); i++) {
|
||||
for (int i = 0; i < args.size(); ++i) {
|
||||
/* Get the argument name and set a blank value */
|
||||
arg = args.at(i).toLower();
|
||||
value = "";
|
||||
@ -514,7 +514,7 @@ void Rshare::refreshStyleSheet(QWidget *widget, bool processChildren)
|
||||
if (processChildren == true) {
|
||||
// process children recursively
|
||||
QObjectList childList = widget->children ();
|
||||
for (QObjectList::Iterator it = childList.begin(); it != childList.end(); it++) {
|
||||
for (QObjectList::Iterator it = childList.begin(); it != childList.end(); ++it) {
|
||||
QWidget *child = qobject_cast<QWidget*>(*it);
|
||||
if (child != NULL) {
|
||||
refreshStyleSheet(child, processChildren);
|
||||
|
@ -169,7 +169,7 @@ bool TokenQueue::activeRequestExist(const uint32_t& userType) const
|
||||
{
|
||||
std::list<TokenRequest>::const_iterator lit = mRequests.begin();
|
||||
|
||||
for(; lit != mRequests.end(); lit++)
|
||||
for(; lit != mRequests.end(); ++lit)
|
||||
{
|
||||
const TokenRequest& req = *lit;
|
||||
|
||||
@ -186,7 +186,7 @@ void TokenQueue::activeRequestTokens(const uint32_t& userType, std::list<uint32_
|
||||
{
|
||||
std::list<TokenRequest>::const_iterator lit = mRequests.begin();
|
||||
|
||||
for(; lit != mRequests.end(); lit++)
|
||||
for(; lit != mRequests.end(); ++lit)
|
||||
{
|
||||
const TokenRequest& req = *lit;
|
||||
|
||||
@ -224,7 +224,7 @@ bool TokenQueue::cancelRequest(const uint32_t token)
|
||||
|
||||
std::list<TokenRequest>::iterator it;
|
||||
|
||||
for(it = mRequests.begin(); it != mRequests.end(); it++)
|
||||
for(it = mRequests.begin(); it != mRequests.end(); ++it)
|
||||
{
|
||||
if (it->mToken == token)
|
||||
{
|
||||
|
@ -215,7 +215,7 @@ QString misc::userFriendlyUnit(double count, unsigned int decimal, double factor
|
||||
QString output;
|
||||
|
||||
int i;
|
||||
for (i = 0; i < 5; i++) {
|
||||
for (i = 0; i < 5; ++i) {
|
||||
if (count < factor) {
|
||||
break;
|
||||
}
|
||||
@ -337,7 +337,7 @@ bool misc::getOpenFileNames(QWidget *parent, RshareSettings::enumLastDir type
|
||||
#ifdef WINDOWS_SYS
|
||||
// fix bug in Qt for Windows Vista and higher, convert path from native separators
|
||||
if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))
|
||||
for (QStringList::iterator file = files.begin(); file != files.end(); file++) {
|
||||
for (QStringList::iterator file = files.begin(); file != files.end(); ++file) {
|
||||
(*file) = QDir::fromNativeSeparators(*file);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user