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

Method removeLibrary

YACReaderLibrary/library_window.cpp:1903–1931  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1901}
1902
1903void LibraryWindow::removeLibrary()
1904{
1905 QString currentLibrary = selectedLibrary->currentText();
1906 QMessageBox *messageBox = new QMessageBox(QMessageBox::Question,
1907 tr("Are you sure?"),
1908 tr("Do you want remove ") + currentLibrary + tr(" library?"),
1909 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No,
1910 this);
1911 messageBox->button(QMessageBox::YesToAll)->setText(tr("Remove and delete metadata"));
1912 messageBox->setWindowModality(Qt::WindowModal);
1913 int ret = messageBox->exec();
1914 if (ret == QMessageBox::Yes) {
1915 libraries.remove(currentLibrary);
1916 selectedLibrary->removeItem(selectedLibrary->currentIndex());
1917 // selectedLibrary->setCurrentIndex(0);
1918 if (libraries.isEmpty()) // no more libraries available.
1919 {
1920 contentViewsManager->comicsView->setModel(NULL);
1921 foldersView->setModel(NULL);
1922 listsView->setModel(NULL);
1923
1924 actions.disableAllActions();
1925 showNoLibrariesWidget();
1926 }
1927 libraries.save();
1928 } else if (ret == QMessageBox::YesToAll) {
1929 deleteCurrentLibrary();
1930 }
1931}
1932
1933void LibraryWindow::renameLibrary()
1934{

Callers

nothing calls this directly

Calls 10

currentTextMethod · 0.80
execMethod · 0.80
removeItemMethod · 0.80
isEmptyMethod · 0.80
disableAllActionsMethod · 0.80
setTextMethod · 0.45
removeMethod · 0.45
currentIndexMethod · 0.45
setModelMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected