Commit d4072aae authored by Ilia Ryabokon's avatar Ilia Ryabokon

Search widget in right palette resolved

parent 58bc81c0
...@@ -114,7 +114,7 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) : ...@@ -114,7 +114,7 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) :
applicationsElement = UBFeature( rootPath, QPixmap(":images/libpalette/ApplicationsCategory.svg"), "Applications" , mUserInteractiveDirectoryPath, FEATURE_CATEGORY); applicationsElement = UBFeature( rootPath, QPixmap(":images/libpalette/ApplicationsCategory.svg"), "Applications" , mUserInteractiveDirectoryPath, FEATURE_CATEGORY);
shapesElement = UBFeature( rootPath, QPixmap(":images/libpalette/ShapesCategory.svg"), "Shapes" , mLibShapesDirectoryPath, FEATURE_CATEGORY ); shapesElement = UBFeature( rootPath, QPixmap(":images/libpalette/ShapesCategory.svg"), "Shapes" , mLibShapesDirectoryPath, FEATURE_CATEGORY );
favoriteElement = UBFeature( rootPath, QPixmap(":images/libpalette/FavoritesCategory.svg"), "Favorites", QUrl("favorites"), FEATURE_FAVORITE ); favoriteElement = UBFeature( rootPath, QPixmap(":images/libpalette/FavoritesCategory.svg"), "Favorites", QUrl("favorites"), FEATURE_FAVORITE );
webSearchElement = UBFeature( rootPath, QPixmap(":images/libpalette/WebSearchCategory.svg"), "Web search", mLibSearchDirectoryPath, FEATURE_SEARCH); webSearchElement = UBFeature( rootPath, QPixmap(":images/libpalette/WebSearchCategory.svg"), "Web search", mLibSearchDirectoryPath, FEATURE_CATEGORY);
trashElement = UBFeature( rootPath, QPixmap(":images/libpalette/TrashCategory.svg"), "Trash", trashDirectoryPath, FEATURE_TRASH ); trashElement = UBFeature( rootPath, QPixmap(":images/libpalette/TrashCategory.svg"), "Trash", trashDirectoryPath, FEATURE_TRASH );
...@@ -171,18 +171,25 @@ void UBFeaturesController::scanFS() ...@@ -171,18 +171,25 @@ void UBFeaturesController::scanFS()
} }
} }
fileSystemScan(mUserInteractiveDirectoryPath, appPath); //Claudio:
fileSystemScan(mUserAudioDirectoryPath, audiosPath); // don't change the order of the scans
fileSystemScan(mUserPicturesDirectoryPath, picturesPath); fileSystemScan( mLibAudiosDirectoryPath, audiosPath);
fileSystemScan(mUserVideoDirectoryPath, moviesPath); fileSystemScan( mLibVideosDirectoryPath, moviesPath);
fileSystemScan(mUserAnimationDirectoryPath, flashPath); fileSystemScan( mLibAnimationsDirectoryPath, flashPath);
fileSystemScan( mLibPicturesDirectoryPath, picturesPath );
fileSystemScan( mUserInteractiveDirectoryPath, appPath );
fileSystemScan( mUserAudioDirectoryPath, audiosPath );
fileSystemScan( mUserPicturesDirectoryPath, picturesPath );
fileSystemScan( mUserVideoDirectoryPath, moviesPath );
fileSystemScan( mUserAnimationDirectoryPath, flashPath );
fileSystemScan( mLibApplicationsDirectoryPath, appPath );
fileSystemScan( mLibShapesDirectoryPath, shapesPath );
fileSystemScan( mLibInteractiveDirectoryPath, interactPath );
fileSystemScan( trashDirectoryPath, trashPath );
fileSystemScan( mLibSearchDirectoryPath, rootPath + "/" + "Web search" );
fileSystemScan(mLibApplicationsDirectoryPath, appPath);
fileSystemScan( mLibPicturesDirectoryPath, picturesPath);
fileSystemScan( mLibShapesDirectoryPath, shapesPath);
fileSystemScan( mLibInteractiveDirectoryPath, interactPath);
fileSystemScan( trashDirectoryPath, trashPath);
fileSystemScan( mLibSearchDirectoryPath, rootPath + "/" + "Web search");
} }
void UBFeaturesController::fileSystemScan(const QUrl & currentPath, const QString & currVirtualPath) void UBFeaturesController::fileSystemScan(const QUrl & currentPath, const QString & currVirtualPath)
...@@ -464,23 +471,29 @@ UBFeature UBFeaturesController::getParentFeatureForUrl( const QUrl &url ) ...@@ -464,23 +471,29 @@ UBFeature UBFeaturesController::getParentFeatureForUrl( const QUrl &url )
return UBFeature(); return UBFeature();
} }
UBFeature UBFeaturesController::addDownloadedFile( const QUrl &sourceUrl, const QByteArray &pData ) void UBFeaturesController::addDownloadedFile(const QUrl &sourceUrl, const QByteArray &pData)
{ {
UBFeature dest = getParentFeatureForUrl( sourceUrl ); UBFeature dest = getParentFeatureForUrl( sourceUrl );
if ( dest == UBFeature() ) if ( dest == UBFeature() )
return UBFeature(); return;
QString fileName = QFileInfo( sourceUrl.toString() ).fileName(); QString fileName = QFileInfo( sourceUrl.toString() ).fileName();
QString filePath = dest.getFullPath().toLocalFile() + "/" + fileName; QString filePath = dest.getFullPath().toLocalFile() + "/" + fileName;
QFile file( filePath ); QFile file( filePath );
if( file.open(QIODevice::WriteOnly )) if ( file.open(QIODevice::WriteOnly ))
{ {
file.write(pData); file.write(pData);
file.close(); file.close();
return UBFeature( dest.getFullVirtualPath(), thumbnailForFile( filePath ),
fileName, QUrl::fromLocalFile(filePath), FEATURE_ITEM ); UBFeature downloadedFeature = UBFeature( dest.getFullVirtualPath(), thumbnailForFile( filePath ),
fileName, QUrl::fromLocalFile(filePath), FEATURE_ITEM);
if (downloadedFeature != UBFeature()) {
featuresModel->addItem(downloadedFeature);
} }
return UBFeature(); }
} }
UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeature &destination ) UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeature &destination )
...@@ -523,7 +536,7 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu ...@@ -523,7 +536,7 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu
void UBFeaturesController::rescanModel() void UBFeaturesController::rescanModel()
{ {
featuresModel->removeRows(0, featuresList->count() - 1); featuresModel->removeRows(0, featuresList->count());
//Could implement infolder scanning for better perfomance //Could implement infolder scanning for better perfomance
scanFS(); scanFS();
......
...@@ -101,7 +101,7 @@ public: ...@@ -101,7 +101,7 @@ public:
void setCurrentElement( const UBFeature &elem ) {currentElement = elem;} void setCurrentElement( const UBFeature &elem ) {currentElement = elem;}
const UBFeature & getTrashElement () const { return trashElement; } const UBFeature & getTrashElement () const { return trashElement; }
UBFeature addDownloadedFile( const QUrl &sourceUrl, const QByteArray &pData ); void addDownloadedFile( const QUrl &sourceUrl, const QByteArray &pData );
UBFeature moveItemToFolder( const QUrl &url, const UBFeature &destination ); UBFeature moveItemToFolder( const QUrl &url, const UBFeature &destination );
UBFeature copyItemToFolder( const QUrl &url, const UBFeature &destination ); UBFeature copyItemToFolder( const QUrl &url, const UBFeature &destination );
......
This diff is collapsed.
...@@ -60,7 +60,6 @@ public: ...@@ -60,7 +60,6 @@ public:
static const int minThumbnailSize = 20; static const int minThumbnailSize = 20;
static const int maxThumbnailSize = 100; static const int maxThumbnailSize = 100;
static const int defaultThumbnailSize = 40; static const int defaultThumbnailSize = 40;
//<<<<<<< HEAD
public: public:
int scrollbarHorisontalPadding() const { return 10;} int scrollbarHorisontalPadding() const { return 10;}
...@@ -75,90 +74,27 @@ private slots: ...@@ -75,90 +74,27 @@ private slots:
void addToFavorite( const UBFeaturesMimeData *); void addToFavorite( const UBFeaturesMimeData *);
void removeFromFavorite( const UBFeaturesMimeData * ); void removeFromFavorite( const UBFeaturesMimeData * );
void onDisplayMetadata( QMap<QString,QString> ); void onDisplayMetadata( QMap<QString,QString> );
//=======
//private:
// void switchToListView();
// void switchToProperties();
// void switchToWebView();
// UBFeaturesController *controller;
// UBFeaturesItemDelegate *itemDelegate;
// UBFeaturesPathItemDelegate *pathItemDelegate;
// UBFeaturesModel *featuresModel;
// UBFeaturesProxyModel *featuresProxyModel;
// UBFeaturesSearchProxyModel *featuresSearchModel;
// UBFeaturesPathProxyModel *featuresPathModel;
// UBFeaturesListView *featuresListView;
// UBFeaturesListView *pathListView;
// QSlider *thumbSlider;
// QVBoxLayout *layout;
// //UBFeaturesPathViewer *pathViewer;
// //QGraphicsScene *pathScene;
// UBFeaturesActionBar *mActionBar;
// UBFeatureProperties *featureProperties;
// UBFeaturesWebView *webView;
// QStackedWidget *stackedWidget;
// int currentStackedWidget;
// UBDownloadHttpFile* imageGatherer;
//private slots:
//
// void currentSelected( const QModelIndex & );
// //void currentPathChanged(const QString &);
// void currentPathChanged( const QModelIndex & );
// void searchStarted( const QString & );
// void createNewFolder();
// void deleteElements( const QMimeData & );
// void addToFavorite( const QMimeData & );
// void removeFromFavorite( const QMimeData & );
// void thumbnailSizeChanged( int );
// void onDisplayMetadata( QMap<QString,QString> );
//>>>>>>> e38b24544e8b8b1d5bd41dabdeaf588df7d45185
void onAddDownloadedFileToLibrary(bool, QUrl, QString, QByteArray); void onAddDownloadedFileToLibrary(bool, QUrl, QString, QByteArray);
void addElementsToFavorite(); void addElementsToFavorite();
void removeElementsFromFavorite(); void removeElementsFromFavorite();
void deleteSelectedElements(); void deleteSelectedElements();
//<<<<<<< HEAD
void rescanModel(); void rescanModel();
private: private:
void switchToListView(); void switchToListView();
void switchToProperties(); void switchToProperties();
void switchToWebView(); void switchToWebView();
void updateSliderPosition();
private: private:
UBFeaturesController *controller; UBFeaturesController *controller;
UBFeaturesItemDelegate *itemDelegate;
UBFeaturesPathItemDelegate *pathItemDelegate;
UBFeaturesModel *featuresModel;
UBFeaturesProxyModel *featuresProxyModel;
UBFeaturesSearchProxyModel *featuresSearchModel;
UBFeaturesPathProxyModel *featuresPathModel;
UBFeaturesNavigatorWidget *mNavigator; UBFeaturesNavigatorWidget *mNavigator;
UBFeaturesListView *pathListView; UBFeaturesListView *pathListView;
QVBoxLayout *layout; QVBoxLayout *layout;
UBFeaturesActionBar *mActionBar; UBFeaturesActionBar *mActionBar;
UBFeatureProperties *featureProperties; UBFeatureProperties *featureProperties;
UBFeaturesWebView *webView; UBFeaturesWebView *webView;
QStackedWidget *stackedWidget; QStackedWidget *stackedWidget;
int currentStackedWidget; int currentStackedWidget;
UBDownloadHttpFile* imageGatherer; UBDownloadHttpFile* imageGatherer;
}; };
...@@ -175,11 +111,6 @@ public: ...@@ -175,11 +111,6 @@ public:
private: private:
QList<UBFeature> mFeatures; QList<UBFeature> mFeatures;
//=======
//protected:
// bool eventFilter(QObject *target, QEvent *event);
//>>>>>>> e38b24544e8b8b1d5bd41dabdeaf588df7d45185
}; };
...@@ -195,16 +126,9 @@ protected: ...@@ -195,16 +126,9 @@ protected:
virtual void dragEnterEvent( QDragEnterEvent *event ); virtual void dragEnterEvent( QDragEnterEvent *event );
virtual void dropEvent( QDropEvent *event ); virtual void dropEvent( QDropEvent *event );
virtual void dragMoveEvent( QDragMoveEvent *event ); virtual void dragMoveEvent( QDragMoveEvent *event );
/*virtual void mousePressEvent( QMouseEvent *event );
virtual void mouseMoveEvent( QMouseEvent *event );
virtual void mouseReleaseEvent( QMouseEvent *event );*/
private slots: private slots:
void thumbnailSizeChanged(int); void thumbnailSizeChanged(int);
private:
//UBRubberBand *rubberBand;
//QPoint rubberOrigin;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment