From 15080783f7f4a8df767723293269f3a733241c8d Mon Sep 17 00:00:00 2001 From: Ilia Ryabokon Date: Wed, 29 Aug 2012 17:28:16 +0300 Subject: [PATCH] Progressbar translations. Checked on Linux --- src/board/UBFeaturesController.cpp | 47 +++++++++++++++--------------- src/board/UBFeaturesController.h | 8 ++--- src/gui/UBFeaturesWidget.cpp | 2 +- 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/board/UBFeaturesController.cpp b/src/board/UBFeaturesController.cpp index 57019aac..6c777e73 100644 --- a/src/board/UBFeaturesController.cpp +++ b/src/board/UBFeaturesController.cpp @@ -36,7 +36,6 @@ const QString UBFeaturesController::webSearchPath = rootPath + "/Web search"; void UBFeaturesComputingThread::scanFS(const QUrl & currentPath, const QString & currVirtualPath, const QSet &pFavoriteSet) { - Q_ASSERT(QFileInfo(currentPath.toLocalFile()).exists()); QFileInfoList fileInfoList = UBFileSystemUtils::allElementsInDirectory(currentPath.toLocalFile()); @@ -73,16 +72,16 @@ void UBFeaturesComputingThread::scanFS(const QUrl & currentPath, const QString & } } -void UBFeaturesComputingThread::scanAll(QList > pScanningData, const QSet &pFavoriteSet) +void UBFeaturesComputingThread::scanAll(QList > pScanningData, const QSet &pFavoriteSet) { for (int i = 0; i < pScanningData.count(); i++) { if (abort) { return; } - QPair curPair = pScanningData.at(i); + QPair curPair = pScanningData.at(i); - emit scanCategory(UBFeaturesController::categoryNameForVirtualPath(curPair.second)); - scanFS(curPair.first, curPair.second, pFavoriteSet); + emit scanCategory(curPair.second.getDisplayName()); + scanFS(curPair.first, curPair.second.getFullVirtualPath(), pFavoriteSet); } } @@ -109,11 +108,11 @@ int UBFeaturesComputingThread::featuresCount(const QUrl &pPath) return noItems; } -int UBFeaturesComputingThread::featuresCountAll(QList > pScanningData) +int UBFeaturesComputingThread::featuresCountAll(QList > pScanningData) { int noItems = 0; for (int i = 0; i < pScanningData.count(); i++) { - QPair curPair = pScanningData.at(i); + QPair curPair = pScanningData.at(i); noItems += featuresCount(curPair.first); } @@ -127,7 +126,7 @@ QThread(parent) abort = false; } -void UBFeaturesComputingThread::compute(const QList > &pScanningData, QSet *pFavoritesSet) +void UBFeaturesComputingThread::compute(const QList > &pScanningData, QSet *pFavoritesSet) { QMutexLocker curLocker(&mMutex); @@ -148,7 +147,7 @@ void UBFeaturesComputingThread::run() qDebug() << "Custom thread started execution"; mMutex.lock(); - QList > searchData = mScanningData; + QList > searchData = mScanningData; QSet favoriteSet = mFavoriteSet; mMutex.unlock(); @@ -339,24 +338,24 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) : void UBFeaturesController::startThread() { - QList > computingData; + QList > computingData; - computingData << QPair(mLibAudiosDirectoryPath, audiosPath) - << QPair(mLibVideosDirectoryPath, moviesPath) - << QPair(mLibAnimationsDirectoryPath, flashPath) - << QPair(mLibPicturesDirectoryPath, picturesPath) + computingData << QPair(mLibAudiosDirectoryPath, audiosElement) + << QPair(mLibVideosDirectoryPath, moviesElement) + << QPair(mLibAnimationsDirectoryPath, flashElement) + << QPair(mLibPicturesDirectoryPath, picturesElement) - << QPair(mUserInteractiveDirectoryPath, appPath) - << QPair(mUserAudioDirectoryPath, audiosPath) - << QPair(mUserPicturesDirectoryPath, picturesPath) - << QPair(mUserVideoDirectoryPath, moviesPath) - << QPair(mUserAnimationDirectoryPath, flashPath) + << QPair(mUserInteractiveDirectoryPath, applicationsElement) + << QPair(mUserAudioDirectoryPath, audiosElement) + << QPair(mUserPicturesDirectoryPath, picturesElement) + << QPair(mUserVideoDirectoryPath, moviesElement) + << QPair(mUserAnimationDirectoryPath, flashElement) - << QPair(mLibApplicationsDirectoryPath, appPath) - << QPair(mLibShapesDirectoryPath, shapesPath) - << QPair(mLibInteractiveDirectoryPath, interactPath) - << QPair(trashDirectoryPath, trashPath) - << QPair(mLibSearchDirectoryPath, rootPath + "/" + "Web search"); + << QPair(mLibApplicationsDirectoryPath, applicationsElement) + << QPair(mLibShapesDirectoryPath, shapesElement) + << QPair(mLibInteractiveDirectoryPath, interactElement) + << QPair(trashDirectoryPath, trashElement) + << QPair(mLibSearchDirectoryPath, webSearchElement); mCThread.compute(computingData, favoriteSet); } diff --git a/src/board/UBFeaturesController.h b/src/board/UBFeaturesController.h index 92c31224..b48f3d62 100644 --- a/src/board/UBFeaturesController.h +++ b/src/board/UBFeaturesController.h @@ -33,7 +33,7 @@ class UBFeaturesComputingThread : public QThread public: explicit UBFeaturesComputingThread(QObject *parent = 0); virtual ~UBFeaturesComputingThread(); - void compute(const QList > &pScanningData, QSet *pFavoritesSet); + void compute(const QList > &pScanningData, QSet *pFavoritesSet); protected: void run(); @@ -51,16 +51,16 @@ public slots: private: void scanFS(const QUrl & currentPath, const QString & currVirtualPath, const QSet &pFavoriteSet); - void scanAll(QList > pScanningData, const QSet &pFavoriteSet); + void scanAll(QList > pScanningData, const QSet &pFavoriteSet); int featuresCount(const QUrl &pPath); - int featuresCountAll(QList > pScanningData); + int featuresCountAll(QList > pScanningData); private: QMutex mMutex; QWaitCondition mWaitCondition; QUrl mScanningPath; QString mScanningVirtualPath; - QList > mScanningData; + QList > mScanningData; QSet mFavoriteSet; bool restart; bool abort; diff --git a/src/gui/UBFeaturesWidget.cpp b/src/gui/UBFeaturesWidget.cpp index 78823404..ee052027 100644 --- a/src/gui/UBFeaturesWidget.cpp +++ b/src/gui/UBFeaturesWidget.cpp @@ -676,7 +676,7 @@ UBFeaturesProgressInfo::UBFeaturesProgressInfo(QWidget *parent) : void UBFeaturesProgressInfo::setCommmonInfoText(const QString &str) { - mProgressBar->setFormat(str + tr(" load") + "(%p%)"); + mProgressBar->setFormat(tr("Loading ") + str + " (%p%)"); } void UBFeaturesProgressInfo::setDetailedInfoText(const QString &str)