Browse Source

Fix trailing whitespace in multiple files

Also fix formatting of CODING_GUIDELINES.md
adaptive-webui-19844
FranciscoPombal 4 years ago
parent
commit
ef1c7eec74
  1. 2
      AUTHORS
  2. 220
      CODING_GUIDELINES.md
  3. 2
      dist/unix/org.qbittorrent.qBittorrent.desktop
  4. 8
      dist/windows/UAC.nsh
  5. 4
      m4/pkg.m4
  6. 2
      src/gui/executionlogwidget.h
  7. 440
      src/gui/gpl.html
  8. 2
      src/gui/gui.pri
  9. 6
      src/icons/build-icons/Gruntfile.js
  10. 26
      src/searchengine/nova3/socks.py
  11. 2
      src/webui/api/appcontroller.h
  12. 16
      src/webui/www/tstool.py

2
AUTHORS

@ -87,7 +87,7 @@ Images Authors: @@ -87,7 +87,7 @@ Images Authors:
* file: src/icons/oxygen/checked.png
copyright: Victor Buinsky <allok.victor@gmail.com>
* file: src/icons/skin/ratio.png
copyright: Fatcow Web Hosting
license: Creative Commons Attribution 3.0 License

220
CODING_GUIDELINES.md

@ -1,12 +1,14 @@ @@ -1,12 +1,14 @@
All new code **must** follow the following coding guidelines.
If you make changes in a file that still uses another coding style, make sure that you follow these guidelines for your changes.
# Coding Guidelines
All new code **must** follow the following coding guidelines. \
If you make changes in a file that still uses another coding style, make sure that you follow these guidelines for your changes. \
For programming languages other than C++ (e.g. JavaScript) used in this repository and submodules, unless otherwise specified, coding guidelines listed here applies as much as possible.
**Note 1:** I will not take your head if you forget and use another style. However, most probably the request will be delayed until you fix your coding style.
**Note 2:** You can use the `uncrustify` program/tool to clean up any source file. Use it with the `uncrustify.cfg` configuration file found in the root folder.
**Note 3:** There is also a style for QtCreator but it doesn't cover all cases. In QtCreator `Tools->Options...->C++->Code Style->Import...` and choose the `codingStyleQtCreator.xml` file found in the root folder.
**Note 1:** I will not take your head if you forget and use another style. However, most probably the request will be delayed until you fix your coding style. \
**Note 2:** You can use the `uncrustify` program/tool to clean up any source file. Use it with the `uncrustify.cfg` configuration file found in the root folder. \
**Note 3:** There is also a style for QtCreator but it doesn't cover all cases. In QtCreator `Tools->Options...->C++->Code Style->Import...` and choose the `codingStyleQtCreator.xml` file found in the root folder.
### Table Of Contents
## Table Of Contents
* [1. New lines &amp; curly braces](#1-new-lines--curly-braces)
* [a. Function blocks, class/struct definitions, namespaces](#a-function-blocks-classstruct-definitions-namespaces)
@ -29,11 +31,13 @@ For programming languages other than C++ (e.g. JavaScript) used in this reposito @@ -29,11 +31,13 @@ For programming languages other than C++ (e.g. JavaScript) used in this reposito
* [9. Misc](#9-misc)
* [10. Git commit message](#10-git-commit-message)
* [11. Not covered above](#11-not-covered-above)
---
### 1. New lines & curly braces ###
## 1. New lines & curly braces
### a. Function blocks, class/struct definitions, namespaces
#### a. Function blocks, class/struct definitions, namespaces ####
```c++
int myFunction(int a)
{
@ -79,7 +83,8 @@ namespace Name @@ -79,7 +83,8 @@ namespace Name
}
```
#### b. Other code blocks ####
### b. Other code blocks
```c++
if (condition) {
// code
@ -99,7 +104,8 @@ default: @@ -99,7 +104,8 @@ default:
}
```
#### c. Blocks in switch's case labels ####
### c. Blocks in switch's case labels
```c++
switch (var) {
case 1: {
@ -117,8 +123,10 @@ default: @@ -117,8 +123,10 @@ default:
}
```
#### d. If-else statements ####
### d. If-else statements
The `else if`/`else` must be on their own lines:
```c++
if (condition) {
// code
@ -131,8 +139,10 @@ else { @@ -131,8 +139,10 @@ else {
}
```
#### e. Single statement if blocks ####
### e. Single statement if blocks
Most single statement if blocks should look like this:
```c++
if (condition)
a = a + b;
@ -141,6 +151,7 @@ if (condition) @@ -141,6 +151,7 @@ if (condition)
One acceptable exception to this can be `return`, `break` or `continue` statements,
provided that the test condition isn't very long and its body statement occupies only one line.
However you can still choose to use the first rule.
```c++
if (a > 0) return;
@ -150,10 +161,12 @@ while (p) { @@ -150,10 +161,12 @@ while (p) {
}
```
#### f. Acceptable conditions to omit braces ####
### f. Acceptable conditions to omit braces
When the conditional statement in `if`/`else` has only one line and its body occupy only one line,
this also applies to loops statements.
this also applies to loops statements. \
Notice that for a series of `if - else` branches, if one branch needs braces then all branches must add braces.
```c++
if (a < b) // conditional statement
do(a); // body
@ -177,9 +190,11 @@ else { @@ -177,9 +190,11 @@ else {
}
```
#### g. Brace enclosed initializers ####
Unlike single-line functions, you must not insert spaces between the brackets and concluded expressions.<br/>
### g. Brace enclosed initializers
Unlike single-line functions, you must not insert spaces between the brackets and concluded expressions. \
But you must insert a space between the variable name and initializer.
```c++
Class obj {}; // empty
Class obj {expr};
@ -187,15 +202,18 @@ Class obj {expr1, /*...,*/ exprN}; @@ -187,15 +202,18 @@ Class obj {expr1, /*...,*/ exprN};
QVariantMap map {{"key1", 5}, {"key2", 10}};
```
### 2. Indentation ###
## 2. Indentation
4 spaces.
### 3. File encoding and line endings ###
## 3. File encoding and line endings
UTF-8 and Unix-like line ending (LF). Unless some platform specific files need other encodings/line endings.
### 4. Initialization lists ###
## 4. Initialization lists
Initialization lists should be vertical. This will allow for more easily readable diffs. The initialization colon should be indented and in its own line along with first argument. The rest of the arguments should be indented too and have the comma prepended.
```c++
myClass::myClass(int a, int b, int c, int d)
: m_a(a)
@ -207,8 +225,10 @@ myClass::myClass(int a, int b, int c, int d) @@ -207,8 +225,10 @@ myClass::myClass(int a, int b, int c, int d)
}
```
### 5. Enums ###
## 5. Enums
Enums should be vertical. This will allow for more easily readable diffs. The members should be indented.
```c++
enum Days
{
@ -222,11 +242,14 @@ enum Days @@ -222,11 +242,14 @@ enum Days
};
```
### 6. Names ###
## 6. Names
All names should be camelCased.
#### a. Type names and namespaces ####
### a. Type names and namespaces
Type names and namespaces start with Upper case letter (except POD types).
```c++
class ClassName {};
@ -241,14 +264,18 @@ namespace NamespaceName @@ -241,14 +264,18 @@ namespace NamespaceName
}
```
#### b. Variable names ####
### b. Variable names
Variable names start with lower case letter.
```c++
int myVar;
```
#### c. Private member variable names ####
### c. Private member variable names
Private member variable names start with lower case letter and should have ```m_``` prefix.
```c++
class MyClass
{
@ -256,23 +283,26 @@ class MyClass @@ -256,23 +283,26 @@ class MyClass
}
```
### 7. Header inclusion order ###
## 7. Header inclusion order
The headers should be placed in the following group order:
1. Module header (in .cpp)
2. C++ Standard Library headers
3. System headers
4. Boost library headers
5. Libtorrent headers
6. Qt headers
7. qBittorrent's own headers, starting from the *base* headers.
The headers should be ordered alphabetically within each group.
If there are conditionals for the same header group, then put them at the bottom of the respective group.
1. Module header (in .cpp)
2. C++ Standard Library headers
3. System headers
4. Boost library headers
5. Libtorrent headers
6. Qt headers
7. qBittorrent's own headers, starting from the *base* headers.
The headers should be ordered alphabetically within each group. \
If there are conditionals for the same header group, then put them at the bottom of the respective group. \
If there are conditionals that contain headers from several different header groups, then put them above the "qBittorrent's own headers" group.
One exception is the header containing the library version (for example, QtGlobal), this particular header isn't constrained by the aforementioned order.
Example:
```c++
// file: examplewidget.cpp
@ -322,8 +352,10 @@ Example: @@ -322,8 +352,10 @@ Example:
#include "ui_examplewidget.h"
```
### 8. Include guard ###
## 8. Include guard
`#pragma once` should be used instead of "include guard" in new code:
```c++
// examplewidget.h
@ -338,75 +370,73 @@ class ExampleWidget : public QWidget @@ -338,75 +370,73 @@ class ExampleWidget : public QWidget
```
### 9. Misc ###
## 9. Misc
* Line breaks for long lines with operation:
```c++
a += "b"
+ "c"
+ "d";
```
```c++
a += "b"
+ "c"
+ "d";
```
* **auto** keyword
We allow the use of the **auto** keyword only where it is strictly necessary
(for example, to declare a lambda object, etc.), or where it **enhances** the readability of the code.
Declarations for which one can gather enough information about the object interface (type) from its name
or the usage pattern (an iterator or a loop variable are good examples of clear patterns)
or the right part of the expression nicely fit here.<br/>
<br/>
When weighing whether to use an auto-typed variable please think about potential reviewers of your code,
who will read it as a plain diff (on github.com, for instance). Please make sure that such reviewers can
understand the code completely and without excessive effort.<br/>
<br/>
Some valid use cases:
```c++
template <typename List>
void doSomethingWithList(const List &list)
{
foreach (const auto &item, list) {
// we don't know item type here so we use 'auto' keyword
// do something with item
}
}
We allow the use of the **auto** keyword only where it is strictly necessary (for example, to declare a lambda object, etc.), or where it **enhances** the readability of the code. \
Declarations for which one can gather enough information about the object interface (type) from its name or the usage pattern (an iterator or a loop variable are good examples of clear patterns) or the right part of the expression nicely fit here.
for (auto it = container.begin(), end = container.end(); it != end; ++it) {
// we don't need to know the exact iterator type,
// because all iterators have the same interface
}
When weighing whether to use an auto-typed variable please think about potential reviewers of your code, who will read it as a plain diff (on github.com, for instance). \
Please make sure that such reviewers can understand the code completely and without excessive effort.
auto spinBox = static_cast<QSpinBox*>(sender());
// we know the variable type based on the right-hand expression
```
Some valid use cases:
* Notice the spaces in the following specific situations:
```c++
// Before and after the assignment and other binary (and ternary) operators there should be a space
// There should not be a space between increment/decrement and its operand
a += 20;
a = (b <= MAX_B ? b : MAX_B);
++a;
--b;
* Container iteration and casts:
for (int a = 0; a < b; ++b) {
}
```c++
template <typename List>
void doSomethingWithList(const List &list)
{
foreach (const auto &item, list) {
// we don't know item type here so we use 'auto' keyword
// do something with item
}
}
// Range-based for loop, spaces before and after the colon
for (auto i : container) {
}
for (auto it = container.begin(), end = container.end(); it != end; ++it) {
// we don't need to know the exact iterator type,
// because all iterators have the same interface
}
// Derived class, spaces before and after the colon
class Derived : public Base
{
};
```
auto spinBox = static_cast<QSpinBox*>(sender());
// we know the variable type based on the right-hand expression
```
* Notice the spaces in the following specific situations:
```c++
// Before and after the assignment and other binary (and ternary) operators there should be a space
// There should not be a space between increment/decrement and its operand
a += 20;
a = (b <= MAX_B ? b : MAX_B);
++a;
--b;
for (int a = 0; a < b; ++b) {
}
// Range-based for loop, spaces before and after the colon
for (auto i : container) {
}
// Derived class, spaces before and after the colon
class Derived : public Base
{
};
```
* Prefer pre-increment, pre-decrement operators
```c++
++i, --j; // Yes
i++, j--; // No
```
```c++
++i, --j; // Yes
i++, j--; // No
```
* private/public/protected must not be indented
@ -414,7 +444,8 @@ i++, j--; // No @@ -414,7 +444,8 @@ i++, j--; // No
* Method definitions aren't allowed in header files
### 10. Git commit message ###
## 10. Git commit message
1. Limit the subject line to 50 characters. Subject should contain only the very essence of the changes (you should avoid extra details and internals)
2. Separate subject from body with a blank line
3. Capitalize the subject line
@ -424,6 +455,7 @@ i++, j--; // No @@ -424,6 +455,7 @@ i++, j--; // No
7. Use the body to explain what and why vs. how
8. If commit fixes a reported issue, mention it in the message body (e.g. `Closes #4134.`)
### 11. Not covered above ###
If something isn't covered above, just follow the same style the file you are editing has.
## 11. Not covered above
If something isn't covered above, just follow the same style the file you are editing has. \
*This guide is not exhaustive and the style for a particular piece of code not specified here will be determined by project members on code review.*

2
dist/unix/org.qbittorrent.qBittorrent.desktop vendored

@ -147,7 +147,7 @@ Comment[uz@Latn]=BitTorrent orqali fayllarni yuklab olish va baham ko‘rish @@ -147,7 +147,7 @@ Comment[uz@Latn]=BitTorrent orqali fayllarni yuklab olish va baham ko‘rish
GenericName[uz@Latn]=BitTorrent mijozi
Name[uz@Latn]=qBittorrent
Comment[te]=కిిమతిి , పి
GenericName[te]=కిలయి
GenericName[te]=కిలయి
Name[te]=కి
Comment[hi_IN]= अपनइल BitTorrent कयम सउनलड आर स कर
GenericName[hi_IN]=BitTorrent उपभ

8
dist/windows/UAC.nsh vendored

@ -22,7 +22,7 @@ Interactive User (MediumIL) Admin user (HighIL) @@ -22,7 +22,7 @@ Interactive User (MediumIL) Admin user (HighIL)
!ifndef UAC_HDR__INC
!verbose push
!verbose 3
!ifndef UAC_VERBOSE
!ifndef UAC_VERBOSE
!define UAC_VERBOSE 3
!endif
!verbose ${UAC_VERBOSE}
@ -195,7 +195,7 @@ _UAC_L_E_${__UAC_L}: @@ -195,7 +195,7 @@ _UAC_L_E_${__UAC_L}:
!endif
!insertmacro UAC_AsUser_Call Label _UAC_L_F_${__UAC_L} ${UAC_SYNCREGISTERS}|${UAC_SYNCOUTDIR}|${UAC_SYNCINSTDIR} #|${UAC_CLEARERRFLAG}
!if "${workdir}" != ""
pop $outdir
pop $outdir
SetOutPath $outdir
!endif
!macroend
@ -265,7 +265,7 @@ pop $_LOGICLIB_TEMP @@ -265,7 +265,7 @@ pop $_LOGICLIB_TEMP
!macroend
!macro _UAC_AsUser_GenOp outvar op opparam1 opparam2
!define _UAC_AUGOGR_ID _UAC_AUGOGR_OP${outvar}${op}${opparam1}${opparam2}
!ifndef ${_UAC_AUGOGR_ID} ;Has this exact action been done before?
!ifndef ${_UAC_AUGOGR_ID} ;Has this exact action been done before?
!if ${outvar} == $0
!define ${_UAC_AUGOGR_ID} $1
!else
@ -277,7 +277,7 @@ pop $_LOGICLIB_TEMP @@ -277,7 +277,7 @@ pop $_LOGICLIB_TEMP
!else
!define _UAC_AUGOGR_OPP1 ${opparam1}
!define _UAC_AUGOGR_OPP2 ${${_UAC_AUGOGR_ID}}
!endif
!endif
goto ${_UAC_AUGOGR_ID}_C
${_UAC_AUGOGR_ID}_F:
${op} ${_UAC_AUGOGR_OPP1} ${_UAC_AUGOGR_OPP2}

4
m4/pkg.m4

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
#
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
@ -123,7 +123,7 @@ if test $pkg_failed = yes; then @@ -123,7 +123,7 @@ if test $pkg_failed = yes; then
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs

2
src/gui/executionlogwidget.h

@ -49,7 +49,7 @@ class ExecutionLogWidget : public QWidget @@ -49,7 +49,7 @@ class ExecutionLogWidget : public QWidget
public:
ExecutionLogWidget(Log::MsgTypes types, QWidget *parent);
~ExecutionLogWidget();
void setMessageTypes(Log::MsgTypes types);
private:

440
src/gui/gpl.html

@ -17,42 +17,42 @@ modify file(s), you may extend this exception to your version of the file(s), @@ -17,42 +17,42 @@ modify file(s), you may extend this exception to your version of the file(s),
but you are not obligated to do so. If you do not wish to do so, delete this
exception statement from your version.</p>
----------
<h2>GNU General Public License, version 2</h2>
<hr>
<h3>Table of Contents</h3>
<ul>
<h2>GNU General Public License, version 2</h2>
<hr>
<h3>Table of Contents</h3>
<ul>
<li><a name="TOC1" href="#SEC1">GNU GENERAL PUBLIC
LICENSE<!--TRANSLATORS: Don't translate the license; copy msgid's
verbatim!--></a>
<ul>
<li><a name="TOC2" href="#SEC2">Preamble</a></li>
verbatim!--></a>
<ul>
<li><a name="TOC2" href="#SEC2">Preamble</a></li>
<li><a name="TOC3" href="#SEC3">TERMS AND CONDITIONS
FOR COPYING, DISTRIBUTION AND MODIFICATION</a></li>
FOR COPYING, DISTRIBUTION AND MODIFICATION</a></li>
<li><a name="TOC4" href="#SEC4">How to Apply These
Terms to Your New Programs</a></li>
</ul></li>
</ul>
<hr>
<h3><a name="SEC1" href="#TOC1">GNU GENERAL PUBLIC LICENSE</a></h3>
<p>
Terms to Your New Programs</a></li>
</ul></li>
</ul>
<hr>
<h3><a name="SEC1" href="#TOC1">GNU GENERAL PUBLIC LICENSE</a></h3>
<p>
Version 2, June 1991
</p>
<pre>
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
</p>
<pre>
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</pre>
<h3><a name="preamble"></a><a name="SEC2" href="#TOC2">Preamble</a></h3>
<p>
</pre>
<h3><a name="preamble"></a><a name="SEC2" href="#TOC2">Preamble</a></h3>
<p>
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
@ -62,66 +62,66 @@ Foundation's software and to any other program whose authors commit to @@ -62,66 +62,66 @@ Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
</p>
<p>
</p>
<p>
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
</p>
<p>
</p>
<p>
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
</p>
<p>
</p>
<p>
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
</p>
<p>
</p>
<p>
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
</p>
<p>
</p>
<p>
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
</p>
<p>
</p>
<p>
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
</p>
<p>
</p>
<p>
The precise terms and conditions for copying, distribution and
modification follow.
</p>
<h3><a name="terms"></a><a name="SEC3" href="#TOC3">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a></h3>
<a name="section0"></a><p>
<strong>0.</strong>
</p>
<h3><a name="terms"></a><a name="SEC3" href="#TOC3">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a></h3>
<a name="section0"></a><p>
<strong>0.</strong>
This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
@ -131,19 +131,19 @@ that is to say, a work containing the Program or a portion of it, @@ -131,19 +131,19 @@ that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
</p>
<p>
</p>
<p>
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
</p>
<a name="section1"></a><p>
<strong>1.</strong>
</p>
<a name="section1"></a><p>
<strong>1.</strong>
You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
@ -151,39 +151,39 @@ copyright notice and disclaimer of warranty; keep intact all the @@ -151,39 +151,39 @@ copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
</p>
<p>
</p>
<p>
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
</p>
<a name="section2"></a><p>
<strong>2.</strong>
</p>
<a name="section2"></a><p>
<strong>2.</strong>
You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
</p>
<dl>
<dt></dt>
<dd>
<strong>a)</strong>
</p>
<dl>
<dt></dt>
<dd>
<strong>a)</strong>
You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
</dd>
<dt></dt>
<dd>
<strong>b)</strong>
</dd>
<dt></dt>
<dd>
<strong>b)</strong>
You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
</dd>
<dt></dt>
<dd>
<strong>c)</strong>
</dd>
<dt></dt>
<dd>
<strong>c)</strong>
If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
@ -194,10 +194,10 @@ above, provided that you also meet all of these conditions: @@ -194,10 +194,10 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
</dd>
</dl>
<p>
</dd>
</dl>
<p>
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@ -207,62 +207,62 @@ distribute the same sections as part of a whole which is a work based @@ -207,62 +207,62 @@ distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
</p>
<p>
</p>
<p>
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
</p>
<p>
</p>
<p>
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
</p>
<a name="section3"></a><p>
<strong>3.</strong>
</p>
<a name="section3"></a><p>
<strong>3.</strong>
You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
</p>
<!-- we use this doubled UL to get the sub-sections indented, -->
<!-- while making the bullets as unobvious as possible. -->
<dl>
<dt></dt>
<dd>
<strong>a)</strong>
</p>
<!-- we use this doubled UL to get the sub-sections indented, -->
<!-- while making the bullets as unobvious as possible. -->
<dl>
<dt></dt>
<dd>
<strong>a)</strong>
Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
</dd>
<dt></dt>
<dd>
<strong>b)</strong>
</dd>
<dt></dt>
<dd>
<strong>b)</strong>
Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
</dd>
<dt></dt>
<dd>
<strong>c)</strong>
</dd>
<dt></dt>
<dd>
<strong>c)</strong>
Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
</dd>
</dl>
<p>
</dd>
</dl>
<p>
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
@ -273,18 +273,18 @@ anything that is normally distributed (in either source or binary @@ -273,18 +273,18 @@ anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
</p>
<p>
</p>
<p>
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
</p>
<a name="section4"></a><p>
<strong>4.</strong>
</p>
<a name="section4"></a><p>
<strong>4.</strong>
You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@ -292,10 +292,10 @@ void, and will automatically terminate your rights under this License. @@ -292,10 +292,10 @@ void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
</p>
<a name="section5"></a><p>
<strong>5.</strong>
</p>
<a name="section5"></a><p>
<strong>5.</strong>
You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
@ -304,10 +304,10 @@ modifying or distributing the Program (or any work based on the @@ -304,10 +304,10 @@ modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
</p>
<a name="section6"></a><p>
<strong>6.</strong>
</p>
<a name="section6"></a><p>
<strong>6.</strong>
Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
@ -315,10 +315,10 @@ these terms and conditions. You may not impose any further @@ -315,10 +315,10 @@ these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
</p>
<a name="section7"></a><p>
<strong>7.</strong>
</p>
<a name="section7"></a><p>
<strong>7.</strong>
If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
@ -331,16 +331,16 @@ license would not permit royalty-free redistribution of the Program by @@ -331,16 +331,16 @@ license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
</p>
<p>
</p>
<p>
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
</p>
<p>
</p>
<p>
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
@ -351,15 +351,15 @@ through that system in reliance on consistent application of that @@ -351,15 +351,15 @@ through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
</p>
<p>
</p>
<p>
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
</p>
<a name="section8"></a><p>
<strong>8.</strong>
</p>
<a name="section8"></a><p>
<strong>8.</strong>
If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@ -367,17 +367,17 @@ may add an explicit geographical distribution limitation excluding @@ -367,17 +367,17 @@ may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
</p>
<a name="section9"></a><p>
<strong>9.</strong>
</p>
<a name="section9"></a><p>
<strong>9.</strong>
The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
</p>
<p>
</p>
<p>
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
@ -385,10 +385,10 @@ either of that version or of any later version published by the Free @@ -385,10 +385,10 @@ either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
</p>
<a name="section10"></a><p>
<strong>10.</strong>
</p>
<a name="section10"></a><p>
<strong>10.</strong>
If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
@ -396,12 +396,12 @@ Software Foundation, write to the Free Software Foundation; we sometimes @@ -396,12 +396,12 @@ Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
</p>
<a name="section11"></a><p><strong>NO WARRANTY</strong></p>
<p>
<strong>11.</strong>
</p>
<a name="section11"></a><p><strong>NO WARRANTY</strong></p>
<p>
<strong>11.</strong>
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
@ -411,10 +411,10 @@ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS @@ -411,10 +411,10 @@ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
</p>
<a name="section12"></a><p>
<strong>12.</strong>
</p>
<a name="section12"></a><p>
<strong>12.</strong>
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
@ -424,93 +424,93 @@ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY @@ -424,93 +424,93 @@ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
</p>
<h3>END OF TERMS AND CONDITIONS</h3>
<h3><a name="howto"></a><a name="SEC4" href="#TOC4">How to Apply These Terms to Your New Programs</a></h3>
<p>
</p>
<h3>END OF TERMS AND CONDITIONS</h3>
<h3><a name="howto"></a><a name="SEC4" href="#TOC4">How to Apply These Terms to Your New Programs</a></h3>
<p>
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
</p>
<p>
</p>
<p>
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
</p>
<pre>
<var>one line to give the program's name and an idea of what it does.</var>
Copyright (C) <var>yyyy</var> <var>name of author</var>
</p>
<pre>
<var>one line to give the program's name and an idea of what it does.</var>
Copyright (C) <var>yyyy</var> <var>name of author</var>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
</pre>
<p>
</pre>
<p>
Also add information on how to contact you by electronic and paper mail.
</p>
<p>
</p>
<p>
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
</p>
<pre>
Gnomovision version 69, Copyright (C) <var>year</var> <var>name of author</var>
</p>
<pre>
Gnomovision version 69, Copyright (C) <var>year</var> <var>name of author</var>
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
type `show w'. This is free software, and you are welcome
to redistribute it under certain conditions; type `show c'
to redistribute it under certain conditions; type `show c'
for details.
</pre>
<p>
</pre>
<p>
The hypothetical commands <samp>`show w'</samp> and <samp>`show c'</samp> should show
the appropriate parts of the General Public License. Of course, the
commands you use may be called something other than <samp>`show w'</samp> and
<samp>`show c'</samp>; they could even be mouse-clicks or menu items--whatever
suits your program.
</p>
<p>
</p>
<p>
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
</p>
<pre>
</p>
<pre>
Yoyodyne, Inc., hereby disclaims all copyright
interest in the program `Gnomovision'
(which makes passes at compilers) written
(which makes passes at compilers) written
by James Hacker.
<var>signature of Ty Coon</var>, 1 April 1989
Ty Coon, President of Vice
</pre>
<p>
</pre>
<p>
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the
<a href="https://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public License</a>
library. If this is what you want to do, use the
<a href="https://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public License</a>
instead of this License.
</p>
</body>

2
src/gui/gui.pri

@ -169,7 +169,7 @@ unix:!macx:dbus { @@ -169,7 +169,7 @@ unix:!macx:dbus {
HEADERS += \
$$PWD/powermanagement/powermanagement_x11.h \
$$PWD/qtnotify/notifications.h
SOURCES += \
$$PWD/powermanagement/powermanagement_x11.cpp \
$$PWD/qtnotify/notifications.cpp

6
src/icons/build-icons/Gruntfile.js

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
module.exports = function(grunt) {
grunt.initConfig({
svg2png: {
all: {
@ -7,7 +7,7 @@ module.exports = function(grunt) { @@ -7,7 +7,7 @@ module.exports = function(grunt) {
size: 256
},
files: [
{
{
src: ['icons/*.svg']
}
]
@ -16,7 +16,7 @@ module.exports = function(grunt) { @@ -16,7 +16,7 @@ module.exports = function(grunt) {
});
grunt.loadNpmTasks('grunt-svg2png');
grunt.registerTask('default', ['svg2png']);
}

26
src/searchengine/nova3/socks.py

@ -14,7 +14,7 @@ are permitted provided that the following conditions are met: @@ -14,7 +14,7 @@ are permitted provided that the following conditions are met:
3. Neither the name of Dan Haim nor the names of his contributors may be used
to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY DAN HAIM "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
@ -114,15 +114,15 @@ def setdefaultproxy(proxytype=None,addr=None,port=None,rdns=True,username=None,p @@ -114,15 +114,15 @@ def setdefaultproxy(proxytype=None,addr=None,port=None,rdns=True,username=None,p
"""
global _defaultproxy
_defaultproxy = (proxytype,addr,port,rdns,username,password)
class socksocket(socket.socket):
"""socksocket([family[, type[, proto]]]) -> socket object
Open a SOCKS enabled socket. The parameters are the same as
those of the standard socket init. In order for SOCKS to work,
you must specify family=AF_INET, type=SOCK_STREAM and proto=0.
"""
def __init__(self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, _sock=None):
_orgsocket.__init__(self,family,type,proto,_sock)
if _defaultproxy != None:
@ -131,7 +131,7 @@ class socksocket(socket.socket): @@ -131,7 +131,7 @@ class socksocket(socket.socket):
self.__proxy = (None, None, None, None, None, None)
self.__proxysockname = None
self.__proxypeername = None
def __recvall(self, bytes):
"""__recvall(bytes) -> data
Receive EXACTLY the number of bytes requested from the socket.
@ -144,7 +144,7 @@ class socksocket(socket.socket): @@ -144,7 +144,7 @@ class socksocket(socket.socket):
raise GeneralProxyError("connection closed unexpectedly")
data = data + d
return data
def setproxy(self,proxytype=None,addr=None,port=None,rdns=True,username=None,password=None):
"""setproxy(proxytype, addr[, port[, rdns[, username[, password]]]])
Sets the proxy to be used.
@ -163,7 +163,7 @@ class socksocket(socket.socket): @@ -163,7 +163,7 @@ class socksocket(socket.socket):
Only relevant when username is also provided.
"""
self.__proxy = (proxytype,addr,port,rdns,username,password)
def __negotiatesocks5(self,destaddr,destport):
"""__negotiatesocks5(self,destaddr,destport)
Negotiates a connection through a SOCKS5 server.
@ -255,26 +255,26 @@ class socksocket(socket.socket): @@ -255,26 +255,26 @@ class socksocket(socket.socket):
self.__proxypeername = (socket.inet_ntoa(ipaddr),destport)
else:
self.__proxypeername = (destaddr,destport)
def getproxysockname(self):
"""getsockname() -> address info
Returns the bound IP address and port number at the proxy.
"""
return self.__proxysockname
def getproxypeername(self):
"""getproxypeername() -> address info
Returns the IP and port number of the proxy.
"""
return _orgsocket.getpeername(self)
def getpeername(self):
"""getpeername() -> address info
Returns the IP address and port number of the destination
machine (note: getproxypeername returns the proxy)
"""
return self.__proxypeername
def __negotiatesocks4(self,destaddr,destport):
"""__negotiatesocks4(self,destaddr,destport)
Negotiates a connection through a SOCKS4 server.
@ -322,7 +322,7 @@ class socksocket(socket.socket): @@ -322,7 +322,7 @@ class socksocket(socket.socket):
self.__proxypeername = (socket.inet_ntoa(ipaddr),destport)
else:
self.__proxypeername = (destaddr,destport)
def __negotiatehttp(self,destaddr,destport):
"""__negotiatehttp(self,destaddr,destport)
Negotiates a connection through an HTTP server.
@ -353,7 +353,7 @@ class socksocket(socket.socket): @@ -353,7 +353,7 @@ class socksocket(socket.socket):
raise HTTPError((statuscode,statusline[2]))
self.__proxysockname = ("0.0.0.0",0)
self.__proxypeername = (addr,destport)
def connect(self,destpair):
"""connect(self,despair)
Connects to the specified destination through a proxy.

2
src/webui/api/appcontroller.h

@ -48,7 +48,7 @@ private slots: @@ -48,7 +48,7 @@ private slots:
void preferencesAction();
void setPreferencesAction();
void defaultSavePathAction();
void networkInterfaceListAction();
void networkInterfaceAddressListAction();
};

16
src/webui/www/tstool.py

@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
# modify file(s), you may extend this exception to your version of the file(s),
# but you are not obligated to do so. If you do not wish to do so, delete this
# exception statement from your version.
import argparse
import copy
import os
@ -62,7 +62,7 @@ def processTranslation(filename, sources): @@ -62,7 +62,7 @@ def processTranslation(filename, sources):
except Exception:
print('\tFailed to parse %s!' % (os.path.normpath(filename)))
return
root = tree.getroot()
for context in root.findall('context'):
context_name = context.find('name').text
@ -70,16 +70,16 @@ def processTranslation(filename, sources): @@ -70,16 +70,16 @@ def processTranslation(filename, sources):
if not has_context and no_obsolete:
root.remove(context)
continue
for message in context.findall('message'):
for location in message.findall('location'):
message.remove(location)
source = message.find('source').text
translation = message.find('translation')
if has_context and source in sources[context_name]:
sources[context_name].remove(source)
trtype = translation.attrib.get('type')
if (trtype == 'obsolete') or (trtype == 'vanished'):
del translation.attrib['type'] # i.e. finished
@ -107,7 +107,7 @@ def processTranslation(filename, sources): @@ -107,7 +107,7 @@ def processTranslation(filename, sources):
for source in sources[context_name]:
message = ET.SubElement(context, 'message')
ET.SubElement(message, 'source').text = source
ET.SubElement(message, 'translation', {'type': 'unfinished'})
ET.SubElement(message, 'translation', {'type': 'unfinished'})
# prettify output xml
indent = ' ' * 4
@ -118,13 +118,13 @@ def processTranslation(filename, sources): @@ -118,13 +118,13 @@ def processTranslation(filename, sources):
context.find('./name').tail = '\n' + indent
messages = context.findall('./message')
if len(messages) == 0: continue
for message in messages:
message.text = '\n' + (indent * 2)
message.tail = '\n' + indent
elems = message.findall('./')
if len(elems) == 0: continue
for elem in elems:
elem.tail = '\n' + (indent * 2)
elems[-1:][0].tail = '\n' + indent

Loading…
Cancel
Save