MCPcopy Create free account
hub / github.com/YACReader/yacreader / deleteCurrentLibrary

Method deleteCurrentLibrary

YACReaderLibrary/library_window.cpp:1882–1901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1880}
1881
1882void 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
1903void LibraryWindow::removeLibrary()
1904{

Callers

nothing calls this directly

Calls 9

getPathMethod · 0.80
currentTextMethod · 0.80
removeItemMethod · 0.80
isEmptyMethod · 0.80
disableAllActionsMethod · 0.80
removeMethod · 0.45
currentIndexMethod · 0.45
setModelMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected