mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-22 05:14:31 -04:00
moved FileDetail structure in SearchDialog where it belongs
This commit is contained in:
parent
2a1991fe85
commit
e8187dbeab
4 changed files with 15 additions and 6 deletions
|
@ -86,6 +86,18 @@ const int SearchDialog::FILETYPE_IDX_DIRECTORY = 8;
|
||||||
QMap<int, QString> * SearchDialog::FileTypeExtensionMap = new QMap<int, QString>();
|
QMap<int, QString> * SearchDialog::FileTypeExtensionMap = new QMap<int, QString>();
|
||||||
bool SearchDialog::initialised = false;
|
bool SearchDialog::initialised = false;
|
||||||
|
|
||||||
|
struct SearchDialog::FileDetail
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
RsPeerId id;
|
||||||
|
std::string name;
|
||||||
|
RsFileHash hash;
|
||||||
|
std::string path;
|
||||||
|
uint64_t size;
|
||||||
|
uint32_t mtime;
|
||||||
|
uint32_t rank;
|
||||||
|
};
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
SearchDialog::SearchDialog(QWidget *parent)
|
SearchDialog::SearchDialog(QWidget *parent)
|
||||||
: MainPage(parent),
|
: MainPage(parent),
|
||||||
|
@ -968,7 +980,7 @@ void SearchDialog::searchKeywords(const QString& keywords)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchDialog::updateFiles(qulonglong search_id,FileDetail file)
|
void SearchDialog::updateFiles(qulonglong search_id,const FileDetail& file)
|
||||||
{
|
{
|
||||||
searchResultsQueue.push_back(std::pair<qulonglong,FileDetail>(search_id,file)) ;
|
searchResultsQueue.push_back(std::pair<qulonglong,FileDetail>(search_id,file)) ;
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ class SearchDialog : public MainPage
|
||||||
Q_PROPERTY(QColor textColorLowSources READ textColorLowSources WRITE setTextColorLowSources)
|
Q_PROPERTY(QColor textColorLowSources READ textColorLowSources WRITE setTextColorLowSources)
|
||||||
Q_PROPERTY(QColor textColorHighSources READ textColorHighSources WRITE setTextColorHighSources)
|
Q_PROPERTY(QColor textColorHighSources READ textColorHighSources WRITE setTextColorHighSources)
|
||||||
|
|
||||||
|
struct FileDetail; // useful structure to store search results.
|
||||||
public:
|
public:
|
||||||
/** Default Constructor */
|
/** Default Constructor */
|
||||||
SearchDialog(QWidget *parent = 0);
|
SearchDialog(QWidget *parent = 0);
|
||||||
|
@ -63,8 +64,7 @@ public:
|
||||||
void setTextColorLowSources(QColor color) { mTextColorLowSources = color; }
|
void setTextColorLowSources(QColor color) { mTextColorLowSources = color; }
|
||||||
void setTextColorHighSources(QColor color) { mTextColorHighSources = color; }
|
void setTextColorHighSources(QColor color) { mTextColorHighSources = color; }
|
||||||
|
|
||||||
public slots:
|
void updateFiles(qulonglong request_id, const FileDetail& file) ;
|
||||||
void updateFiles(qulonglong request_id,FileDetail file) ;
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,6 @@ class NotifyQt: public QObject, public NotifyClient
|
||||||
void chatStatusChanged(const ChatId&,const QString&) const ;
|
void chatStatusChanged(const ChatId&,const QString&) const ;
|
||||||
void chatCleared(const ChatId&) const ;
|
void chatCleared(const ChatId&) const ;
|
||||||
void peerHasNewCustomStateString(const QString& /* peer_id */, const QString& /* status_string */) const ;
|
void peerHasNewCustomStateString(const QString& /* peer_id */, const QString& /* status_string */) const ;
|
||||||
void gotTurtleSearchResult(qulonglong search_id,FileDetail file) const ;
|
|
||||||
void peerHasNewAvatar(const QString& peer_id) const ;
|
void peerHasNewAvatar(const QString& peer_id) const ;
|
||||||
void ownAvatarChanged() const ;
|
void ownAvatarChanged() const ;
|
||||||
void ownStatusMessageChanged() const ;
|
void ownStatusMessageChanged() const ;
|
||||||
|
|
|
@ -536,11 +536,9 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
|
||||||
// avoid clashes between infos from threads.
|
// avoid clashes between infos from threads.
|
||||||
//
|
//
|
||||||
|
|
||||||
qRegisterMetaType<FileDetail>("FileDetail") ;
|
|
||||||
qRegisterMetaType<RsPeerId>("RsPeerId") ;
|
qRegisterMetaType<RsPeerId>("RsPeerId") ;
|
||||||
|
|
||||||
std::cerr << "connecting signals and slots" << std::endl ;
|
std::cerr << "connecting signals and slots" << std::endl ;
|
||||||
// QObject::connect(notify,SIGNAL(gotTurtleSearchResult(qulonglong,FileDetail)),w->transfersDialog->searchDialog ,SLOT(updateFiles(qulonglong,FileDetail))) ;
|
|
||||||
QObject::connect(notify,SIGNAL(deferredSignatureHandlingRequested()),notify,SLOT(handleSignatureEvent()),Qt::QueuedConnection) ;
|
QObject::connect(notify,SIGNAL(deferredSignatureHandlingRequested()),notify,SLOT(handleSignatureEvent()),Qt::QueuedConnection) ;
|
||||||
QObject::connect(notify,SIGNAL(chatLobbyTimeShift(int)),notify,SLOT(handleChatLobbyTimeShift(int)),Qt::QueuedConnection) ;
|
QObject::connect(notify,SIGNAL(chatLobbyTimeShift(int)),notify,SLOT(handleChatLobbyTimeShift(int)),Qt::QueuedConnection) ;
|
||||||
QObject::connect(notify,SIGNAL(diskFull(int,int)) ,w ,SLOT(displayDiskSpaceWarning(int,int))) ;
|
QObject::connect(notify,SIGNAL(diskFull(int,int)) ,w ,SLOT(displayDiskSpaceWarning(int,int))) ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue