Improve coding style

This commit is contained in:
Vladimir Golovnev (Glassez) 2020-11-16 10:02:11 +03:00
parent acad35c5bc
commit c41df9ffbd
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
147 changed files with 4454 additions and 2227 deletions

View file

@ -58,23 +58,27 @@ QString TorrentCategoryDialog::createCategory(QWidget *parent, const QString &pa
TorrentCategoryDialog dialog(parent);
dialog.setCategoryName(newCategoryName);
while (dialog.exec() == TorrentCategoryDialog::Accepted) {
while (dialog.exec() == TorrentCategoryDialog::Accepted)
{
newCategoryName = dialog.categoryName();
if (!BitTorrent::Session::isValidCategoryName(newCategoryName)) {
if (!BitTorrent::Session::isValidCategoryName(newCategoryName))
{
QMessageBox::critical(
parent, tr("Invalid category name")
, tr("Category name cannot contain '\\'.\n"
"Category name cannot start/end with '/'.\n"
"Category name cannot contain '//' sequence."));
}
else if (BitTorrent::Session::instance()->categories().contains(newCategoryName)) {
else if (BitTorrent::Session::instance()->categories().contains(newCategoryName))
{
QMessageBox::critical(
parent, tr("Category creation error")
, tr("Category with the given name already exists.\n"
"Please choose a different name and try again."));
}
else {
else
{
Session::instance()->addCategory(newCategoryName, dialog.savePath());
return newCategoryName;
}