mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07:00
Improve coding style
This commit is contained in:
parent
acad35c5bc
commit
c41df9ffbd
147 changed files with 4454 additions and 2227 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue