| 18 | } |
| 19 | |
| 20 | void YACReaderLibraryListWidget::addItem(QString name, QString path) |
| 21 | { |
| 22 | QVBoxLayout *mainLayout = dynamic_cast<QVBoxLayout *>(layout()); |
| 23 | |
| 24 | YACReaderLibraryItemWidget *library = new YACReaderLibraryItemWidget(name, path, this); |
| 25 | connect(library, &YACReaderLibraryItemWidget::showOptions, this, &YACReaderLibraryListWidget::showContextMenu); |
| 26 | QList<YACReaderLibraryItemWidget *>::iterator itr; |
| 27 | int i = 0; |
| 28 | for (itr = librariesList.begin(); itr != librariesList.end() && !naturalSortLessThanCI(name, (*itr)->name); itr++) |
| 29 | i++; |
| 30 | |
| 31 | librariesList.insert(itr, library); |
| 32 | |
| 33 | // connect(library,SIGNAL(selected(QString,QString)),this,SIGNAL(librarySelected(QString,QString))); |
| 34 | // connect(library,SIGNAL(selected(QString,QString)),this,SLOT(updateLibraries(QString,QString))); |
| 35 | |
| 36 | mainLayout->insertWidget(i, library); |
| 37 | } |
| 38 | |
| 39 | QString YACReaderLibraryListWidget::currentText() |
| 40 | { |
no test coverage detected