| 1880 | } |
| 1881 | |
| 1882 | void LibraryWindow::deleteCurrentLibrary() |
| 1883 | { |
| 1884 | QString path = libraries.getPath(selectedLibrary->currentText()); |
| 1885 | libraries.remove(selectedLibrary->currentText()); |
| 1886 | selectedLibrary->removeItem(selectedLibrary->currentIndex()); |
| 1887 | path = LibraryPaths::libraryDatabasePath(path); |
| 1888 | |
| 1889 | QDir d(path); |
| 1890 | d.removeRecursively(); |
| 1891 | if (libraries.isEmpty()) // no more libraries available. |
| 1892 | { |
| 1893 | contentViewsManager->comicsView->setModel(NULL); |
| 1894 | foldersView->setModel(NULL); |
| 1895 | listsView->setModel(NULL); |
| 1896 | |
| 1897 | actions.disableAllActions(); |
| 1898 | showNoLibrariesWidget(); |
| 1899 | } |
| 1900 | libraries.save(); |
| 1901 | } |
| 1902 | |
| 1903 | void LibraryWindow::removeLibrary() |
| 1904 | { |
nothing calls this directly
no test coverage detected