mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-25 23:49:35 -05:00
Moved call to setResizeMode in SharedFilesDialog after the call to setModel on QTreeView.
Qt shows an assertion in debug mode when column count is 0. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6152 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
5aa6afbfdb
commit
2ed1712580
@ -36,7 +36,7 @@
|
||||
#endif
|
||||
#include "RetroShareLink.h"
|
||||
#include "ShareManager.h"
|
||||
#include "RemoteDirModel.h"
|
||||
#include "RemoteDirModel.h"
|
||||
#include "ShareDialog.h"
|
||||
#include "common/PeerDefs.h"
|
||||
|
||||
@ -56,8 +56,8 @@
|
||||
#define IMAGE_COPYLINK ":/images/copyrslink.png"
|
||||
#define IMAGE_OPENFOLDER ":/images/folderopen.png"
|
||||
#define IMAGE_OPENFILE ":/images/fileopen.png"
|
||||
#define IMAGE_COLLECTION ":/images/mimetypes/rscollection-16.png"
|
||||
#define IMAGE_EDITSHARE ":/images/edit_16.png"
|
||||
#define IMAGE_COLLECTION ":/images/mimetypes/rscollection-16.png"
|
||||
#define IMAGE_EDITSHARE ":/images/edit_16.png"
|
||||
|
||||
// Define to avoid using the search in treeview, because it is really slow for now.
|
||||
//
|
||||
@ -130,7 +130,6 @@ SharedFilesDialog::SharedFilesDialog(RetroshareDirModel *_tree_model,RetroshareD
|
||||
|
||||
/* Set header resize modes and initial section sizes */
|
||||
QHeaderView * header = ui.dirTreeView->header () ;
|
||||
header->setResizeMode (0, QHeaderView::Interactive);
|
||||
|
||||
header->resizeSection ( 0, 490 );
|
||||
header->resizeSection ( 1, 70 );
|
||||
@ -327,6 +326,9 @@ void SharedFilesDialog::changeCurrentViewModel(int c)
|
||||
ui.dirTreeView->setModel(proxyModel);
|
||||
ui.dirTreeView->update();
|
||||
|
||||
QHeaderView * header = ui.dirTreeView->header () ;
|
||||
header->setResizeMode (0, QHeaderView::Interactive);
|
||||
|
||||
ui.dirTreeView->header()->headerDataChanged(Qt::Horizontal,0,4) ;
|
||||
|
||||
#ifdef DONT_USE_SEARCH_IN_TREE_VIEW
|
||||
@ -460,7 +462,7 @@ void LocalSharedFilesDialog::createCollectionFile()
|
||||
std::cerr << "Creating a collection file!" << std::endl;
|
||||
QModelIndexList lst = getSelected();
|
||||
model->createCollectionFile(this, lst);
|
||||
}
|
||||
}
|
||||
|
||||
void RemoteSharedFilesDialog::downloadRemoteSelected()
|
||||
{
|
||||
@ -472,24 +474,24 @@ void RemoteSharedFilesDialog::downloadRemoteSelected()
|
||||
QModelIndexList lst = getSelected();
|
||||
model -> downloadSelected(lst);
|
||||
}
|
||||
|
||||
void LocalSharedFilesDialog::editSharePermissions()
|
||||
{
|
||||
std::list<SharedDirInfo> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
std::list<SharedDirInfo>::const_iterator it;
|
||||
for (it = dirs.begin(); it != dirs.end(); it++) {
|
||||
if (currentFile == currentFile) {
|
||||
/* file name found, show dialog */
|
||||
ShareDialog sharedlg (it->filename, this);
|
||||
sharedlg.setWindowTitle(tr("Edit Shared Folder"));
|
||||
sharedlg.exec();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void LocalSharedFilesDialog::editSharePermissions()
|
||||
{
|
||||
std::list<SharedDirInfo> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
std::list<SharedDirInfo>::const_iterator it;
|
||||
for (it = dirs.begin(); it != dirs.end(); it++) {
|
||||
if (currentFile == currentFile) {
|
||||
/* file name found, show dialog */
|
||||
ShareDialog sharedlg (it->filename, this);
|
||||
sharedlg.setWindowTitle(tr("Edit Shared Folder"));
|
||||
sharedlg.exec();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SharedFilesDialog::copyLink (const QModelIndexList& lst, bool remote)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user