Skip to content

Commit 3253747

Browse files
committed
Remove unused alphabetical translation vector
m_AlphabeticalTranslation was written but never read; drop it along with refreshAlphabeticalTranslation, ByName, and the LessThanWrapper helper.
1 parent 688a866 commit 3253747

2 files changed

Lines changed: 0 additions & 38 deletions

File tree

src/downloadmanager.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -868,38 +868,6 @@ void DownloadManager::removeFile(int index, bool deleteFile)
868868
m_DownloadRemoved(index);
869869
}
870870

871-
class LessThanWrapper
872-
{
873-
public:
874-
LessThanWrapper(DownloadManager* manager) : m_Manager(manager) {}
875-
bool operator()(int LHS, int RHS)
876-
{
877-
return m_Manager->getFileName(LHS).compare(m_Manager->getFileName(RHS),
878-
Qt::CaseInsensitive) < 0;
879-
}
880-
881-
private:
882-
DownloadManager* m_Manager;
883-
};
884-
885-
bool DownloadManager::ByName(int LHS, int RHS)
886-
{
887-
return m_ActiveDownloads[LHS]->m_FileName < m_ActiveDownloads[RHS]->m_FileName;
888-
}
889-
890-
void DownloadManager::refreshAlphabeticalTranslation()
891-
{
892-
m_AlphabeticalTranslation.clear();
893-
int pos = 0;
894-
for (QVector<DownloadInfo*>::iterator iter = m_ActiveDownloads.begin();
895-
iter != m_ActiveDownloads.end(); ++iter, ++pos) {
896-
m_AlphabeticalTranslation.push_back(pos);
897-
}
898-
899-
std::sort(m_AlphabeticalTranslation.begin(), m_AlphabeticalTranslation.end(),
900-
LessThanWrapper(this));
901-
}
902-
903871
void DownloadManager::restoreDownload(int index)
904872
{
905873

@@ -2405,7 +2373,6 @@ void DownloadManager::metaDataChanged()
24052373
DirWatcherManager::Guard dirWatcherGuard = m_DirWatcher.scopedGuard();
24062374
info->setName(getDownloadFileName(newName), true);
24072375
}
2408-
refreshAlphabeticalTranslation();
24092376
notifyRowChanged(index);
24102377
if (!info->m_Output.isOpen() &&
24112378
!info->m_Output.open(QIODevice::WriteOnly | QIODevice::Append)) {

src/downloadmanager.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -663,10 +663,6 @@ private slots:
663663

664664
void removeFile(int index, bool deleteFile);
665665

666-
void refreshAlphabeticalTranslation();
667-
668-
bool ByName(int LHS, int RHS);
669-
670666
QString getFileNameFromNetworkReply(QNetworkReply* reply);
671667

672668
void setState(DownloadInfo* info, DownloadManager::DownloadState state);
@@ -694,7 +690,6 @@ private slots:
694690

695691
QString m_OutputDirectory;
696692
std::set<int> m_RequestIDs;
697-
QVector<int> m_AlphabeticalTranslation;
698693

699694
DirWatcherManager m_DirWatcher;
700695

0 commit comments

Comments
 (0)