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

Method rename

YACReaderLibrary/library_window.cpp:1938–1959  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1936}
1937
1938void LibraryWindow::rename(QString newName) // TODO replace
1939{
1940 QString currentLibrary = selectedLibrary->currentText();
1941 if (newName != currentLibrary) {
1942 if (!libraries.contains(newName)) {
1943 libraries.rename(currentLibrary, newName);
1944 // selectedLibrary->removeItem(selectedLibrary->currentIndex());
1945 // libraries.addLibrary(newName,path);
1946 selectedLibrary->renameCurrentLibrary(newName);
1947 libraries.save();
1948 renameLibraryDialog->close();
1949#ifndef Y_MAC_UI
1950 if (!foldersModelProxy->mapToSource(foldersView->currentIndex()).isValid())
1951 libraryToolBar->setCurrentFolderName(selectedLibrary->currentText());
1952#endif
1953 } else {
1954 libraryAlreadyExists(newName);
1955 }
1956 } else
1957 renameLibraryDialog->close();
1958 // selectedLibrary->setCurrentIndex(selectedLibrary->findText(newName));
1959}
1960
1961void LibraryWindow::rescanLibraryForXMLInfo()
1962{

Callers 1

showRenameCurrentListMethod · 0.45

Calls 8

currentTextMethod · 0.80
renameCurrentLibraryMethod · 0.80
setCurrentFolderNameMethod · 0.80
containsMethod · 0.45
saveMethod · 0.45
closeMethod · 0.45
isValidMethod · 0.45
currentIndexMethod · 0.45

Tested by

no test coverage detected