Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Trifonov authored and Oleg Trifonov committed Nov 3, 2014
1 parent 5f2104b commit 89985ef
Show file tree
Hide file tree
Showing 109 changed files with 296 additions and 294 deletions.
2 changes: 1 addition & 1 deletion build_template.properties
Expand Up @@ -25,7 +25,7 @@ app.vendor=Maxence Bernard
app.version=0.9.0

# Fully qualified name of the class that starts muCommander.
app.main=com.mucommander.Launcher
app.main=com.mucommander.TrolCommander

# muCommander copyright line.
app.copyright=2002-2012
Expand Down
50 changes: 24 additions & 26 deletions compile.txt
@@ -1,16 +1,14 @@
--------------------------------------------
muCommander compilation instructions
trolCommander compilation instructions
--------------------------------------------

1. Configuration

The first step to compiling muCommander is making sure all the proper
The first step to compiling trolCommander is making sure all the proper
libraries and tools are installed.

Pre-requesites are:
- JDK 1.6 or greater
Event though muCommander runs on Java 1.5 or later, it takes advantage of
the 1.6 API and needs it in order to compile.
- JDK 1.7 or greater
This can be retrieved from http://java.sun.com/

- Ant 1.6.5 or greater
Expand All @@ -34,38 +32,38 @@ libraries and tools are installed.
It can be retrieved from http://p7zip.sourceforge.net/

Once these tools have been installed, you might want / need to configure
the muCommander build process.
the trolCommander build process.
This is done by copying ./build_template.properties to ./build.properties and
editing it.

The values that need to be set are:
- 7za.executable (non-required)
Path to the 7za executable.
This is used to compress muCommander's JAR file better than Java's ZIP
This is used to compress trolCommander's JAR file better than Java's ZIP
implementation.
If this property is not set, standard ZIP compression will be used.

- store.path (non-required)
Password of the keystore file used to generate a signed muCommander JAR file.
Password of the keystore file used to generate a signed trolCommander JAR file.
If this property is not set, you won't be able to generate signed JAR files.
If you're not Maxence, you can safely ignore this property.

- nsis.dir (non-required)
Path to the NSIS installation directory.
This is used to generate a muCommander Win32 native setup.
This is used to generate a trolCommander Win32 native setup.
If this property is not set, you won't be able to generate Win32 setups.

- launch4j.dir (non-required)
Path to the Launch4J installation directory.
This is used to generate a muCommander Win32 executable.
This is used to generate a trolCommander Win32 executable.
If this property is not set, you won't be able to generate Win32 or portable
releases.



2. Compiling muCommander
2. Compiling trolCommander

There are various ways of compiling muCommander. The most immediately
There are various ways of compiling trolCommander. The most immediately
useful are:

- ant
Expand All @@ -74,17 +72,17 @@ useful are:

- ant jar
This will compile all the modified Java files and store the binaries
in ./dist/mucommander_unobf.jar.
in ./dist/trolcommander_unobf.jar.
This jar file is meant for debug, and running it will output a fair amount
of tracing information.

- ant obfuscate
This will compile and obfuscate all the Java files and store
the binaries in ./dist/mucommander_obf.jar.
the binaries in ./dist/trolcommander_obf.jar.

- ant compress
This is identical to ant obfuscate, but will use 7za if it's available to
produce an even slimmer version of the JAR file in ./dist/mucommander.jar.
produce an even slimmer version of the JAR file in ./dist/trolcommander.jar.
This JAR file is the one we use for release.

- ant clean
Expand All @@ -96,33 +94,33 @@ useful are:

- ant source
Packages the sources and stores them in
./dist/mucommander-<version>-src.tar.gz
./dist/trolcommander-<version>-src.tar.gz

- ant deb
Generates a Debian package in ./dist/mucommander_<version>_all.deb
Generates a Debian package in ./dist/trolcommander_<version>_all.deb

- ant exe
Generates a Win32 executable version of muCommander in ./dist/muCommander.exe.
Generates a Win32 executable version of trolCommander in ./dist/trolCommander.exe.

- ant portable
Generates the portable version of muCommander in
./dist/mucommander-<version>-portable.tar.gz.
Generates the portable version of trolCommander in
./dist/trolcommander-<version>-portable.tar.gz.
The portable version is meant for 'roaming' usage, typically from a USB key.

- ant setup-exe
Generates a Win32 executable setup in ./dist/mucommander-setup.exe
Generates a Win32 executable setup in ./dist/trolcommander-setup.exe

- ant tgz
Generates a Unix release file and stores it in ./dist/mucommander.tar.gz
Generates a Unix release file and stores it in ./dist/trolcommander.tar.gz

- ant jnlp
Generates a Webstart description file in ./dist/mucommander.jnlp
Generates a Webstart description file in ./dist/trolcommander.jnlp

- ant sign
Generates a signed JAR file in ./dist/mucommander_signed.jar
Generates a signed JAR file in ./dist/trolcommander_signed.jar

- ant app
Generates a Mac OS X application bundle in ./dist/muCommander.app.
Generates a Mac OS X application bundle in ./dist/trolCommander.app.
Note that the application will only work if ran on an OS that has a chmod
command.

Expand All @@ -134,4 +132,4 @@ useful are:
Generates all known release files.

- ant reports
Generates reports about various aspects of muCommander.
Generates reports about various aspects of trolCommander.
16 changes: 8 additions & 8 deletions readme.txt
Expand Up @@ -5,31 +5,31 @@
|_|_|_|___|_____|___|_|_|_|_|_|_|__,|_|_|___|___|_|


------------------
muCommander v0.9.1
------------------
--------------------
trolCommander v0.9.4
--------------------

muCommander is a lightweight, cross-platform file manager with a dual-pane interface.
trolCommander is a lightweight, cross-platform file manager with a dual-pane interface.
It runs on any operating system with Java support (Mac OS X, Windows, Linux, *BSD, Solaris...).

Documentation can be found at http://trac.mucommander.com/ .

Please visit the muCommander forums (http://www.mucommander.com/forums) to ask questions, suggest features or
report a bug. Your feedback is always welcome!

Official website: http://www.mucommander.com
Official website: http://trolsoft.ru/en/soft/trolcommander
Copyright (C) 2002-2014 Maxence Bernard.


Requirements
------------

A Java Runtime Environment (JRE) 1.5 or later is required to run muCommander.
Java 1.6 is recommended, you can download it at http://java.com.
A Java Runtime Environment (JRE) 1.7 or later is required to run trolCommander.
Java 1.8 is recommended, you can download it at http://java.com.

Mac OS X users: your favorite OS already comes with a Java runtime so you're good to go!

If you're having problems launching muCommander, make sure the JAVA_HOME environment variable points to the directory
If you're having problems launching trolCommander, make sure the JAVA_HOME environment variable points to the directory
where your Java runtime is installed.


Expand Down
2 changes: 1 addition & 1 deletion src/main/com/ibm/icu/text/CharsetDetector.java
Expand Up @@ -566,7 +566,7 @@ public CharsetDetector setDetectableCharset(String encoding, boolean enabled) {
}

if (fEnabledRecognizers == null && !isDefaultVal) {
// Create an array storing the non default setting
// create an array storing the non default setting
fEnabledRecognizers = new boolean[ALL_CS_RECOGNIZERS.size()];

// Initialize the array with default info
Expand Down
6 changes: 3 additions & 3 deletions src/main/com/ibm/icu/text/CharsetMatch.java
Expand Up @@ -30,7 +30,7 @@ public class CharsetMatch implements Comparable<CharsetMatch> {


/**
* Create a java.io.Reader for reading the Unicode character data corresponding
* create a java.io.Reader for reading the Unicode character data corresponding
* to the original byte data supplied to the Charset detect operation.
* <p/>
* CAUTION: if the source of the byte data was an InputStream, a Reader
Expand Down Expand Up @@ -58,7 +58,7 @@ public Reader getReader() {
}

/**
* Create a Java String from Unicode character data corresponding
* create a Java String from Unicode character data corresponding
* to the original byte data supplied to the Charset detect operation.
*
* @return a String created from the converted input data.
Expand All @@ -71,7 +71,7 @@ public String getString() throws java.io.IOException {
}

/**
* Create a Java String from Unicode character data corresponding
* create a Java String from Unicode character data corresponding
* to the original byte data supplied to the Charset detect operation.
* The length of the returned string is limited to the specified size;
* the string will be trunctated to this length if necessary. A limit value of
Expand Down
2 changes: 1 addition & 1 deletion src/main/com/mucommander/auth/CredentialsManager.java
Expand Up @@ -81,7 +81,7 @@ public class CredentialsManager {
/** True when changes were made after the credentials file was last saved */
private static boolean saveNeeded;

/** Create a singleton instance, needs to be referenced so that it's not garbage collected (AlteredVector
/** create a singleton instance, needs to be referenced so that it's not garbage collected (AlteredVector
* stores VectorChangeListener as weak references) */
private static CredentialsManager singleton = new CredentialsManager();

Expand Down
2 changes: 1 addition & 1 deletion src/main/com/mucommander/bookmark/BookmarkManager.java
Expand Up @@ -65,7 +65,7 @@ public class BookmarkManager implements VectorChangeListener {
/** Last event pause timestamp */
private static long lastEventPauseTime;

/** Create a singleton instance, needs to be referenced so that it's not garbage collected (AlteredVector
/** create a singleton instance, needs to be referenced so that it's not garbage collected (AlteredVector
* stores VectorChangeListener as weak references) */
private static BookmarkManager singleton = new BookmarkManager();

Expand Down
4 changes: 2 additions & 2 deletions src/main/com/mucommander/command/Command.java
Expand Up @@ -404,9 +404,9 @@ public boolean equals(Object object) {
}

public int compareTo(Command command) {
int buffer;
int buffer = getDisplayName().compareTo(command.getDisplayName());

if ((buffer = getDisplayName().compareTo(command.getDisplayName())) != 0)
if (buffer != 0)
return buffer;
if ((buffer = getAlias().compareTo(command.getAlias())) != 0)
return buffer;
Expand Down
4 changes: 2 additions & 2 deletions src/main/com/mucommander/command/CommandBuilder.java
Expand Up @@ -44,7 +44,7 @@
* }
* }
* </pre>
* Passing an instance of <code>CommandPrinter</code> to {@link CommandManager#buildCommands(CommandBuilder)}
* Passing an instance of <code>CommandPrinter</code> to {@link CommandManager@buildCommands(CommandBuilder)}
* will result in something like:
* <pre>
* Beginning command list building...
Expand All @@ -55,7 +55,7 @@
* </p>
* @author Nicolas Rinaudo
* @see CommandReader
* @see CommandManager#buildCommands(CommandBuilder)
* @see CommandManager@buildCommands(CommandBuilder)
*/
public interface CommandBuilder {
/**
Expand Down
Expand Up @@ -282,7 +282,7 @@ protected AbstractFile getArchiveEntryFile(ArchiveEntry entry, AbstractFile pare
FileURL entryURL = (FileURL)archiveURL.clone();
entryURL.setPath(addTrailingSeparator(archiveURL.getPath()) + entryPath);

// Create an RO and RW entry file, depending on whether this archive file is RO or RW
// create an RO and RW entry file, depending on whether this archive file is RO or RW
entryFile = this instanceof AbstractRWArchiveFile
?new RWArchiveEntryFile(
entryURL,
Expand Down
4 changes: 2 additions & 2 deletions src/main/com/mucommander/commons/file/ArchiveEntryTree.java
Expand Up @@ -53,7 +53,7 @@ public void addArchiveEntry(ArchiveEntry entry) {
DefaultMutableTreeNode node = this;
for(int d=1; d<=entryDepth; d++) {
if(d==entryDepth && !entry.isDirectory()) {
// Create a leaf node for the entry
// create a leaf node for the entry
entry.setExists(true); // the entry has to exist
node.add(new DefaultMutableTreeNode(entry, true));
break;
Expand Down Expand Up @@ -86,7 +86,7 @@ public void addArchiveEntry(ArchiveEntry entry) {
}
else {
if(d==entryDepth) {
// Create a leaf node for the entry
// create a leaf node for the entry
entry.setExists(true); // the entry has to exist
node.add(new DefaultMutableTreeNode(entry, true));
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/com/mucommander/commons/file/FileFactory.java
Expand Up @@ -140,7 +140,7 @@ public class FileFactory {
// Set the default FileIconProvider instance
defaultFileIconProvider = new SwingFileIconProvider();

// Create the temp directory folder
// create the temp directory folder
TEMP_DIRECTORY = getFile(System.getProperty("java.io.tmpdir"));
}

Expand Down Expand Up @@ -178,7 +178,7 @@ private FileFactory() {
public static ProtocolProvider registerProtocol(String protocol, ProtocolProvider provider) {
protocol = protocol.toLowerCase();

// Create raw and archive file pools
// create raw and archive file pools
FILE_POOL_MAP.put(protocol, new FilePool());

// Special case for local file provider.
Expand Down Expand Up @@ -470,7 +470,7 @@ public static AbstractFile getFile(FileURL fileURL, AbstractFile parent, Authent
// Test if current file is an archive and if it is, create an archive entry file instead of a raw
// protocol file
if (currentFile == null || !currentFile.isArchive()) {
// Create a fresh FileURL with the current path
// create a fresh FileURL with the current path
FileURL clonedURL = (FileURL)fileURL.clone();
clonedURL.setPath(currentPath);

Expand Down Expand Up @@ -499,7 +499,7 @@ public static AbstractFile getFile(FileURL fileURL, AbstractFile parent, Authent
}
}

// Create last file if it hasn't been already (if the last filename was not an archive), same routine as above
// create last file if it hasn't been already (if the last filename was not an archive), same routine as above
// except that it doesn't wrap the file with an archive file
if (!lastFileResolved) {
// Note: DON'T strip out the trailing separator, as this would cause problems with root resources
Expand Down
4 changes: 2 additions & 2 deletions src/main/com/mucommander/commons/file/FileURL.java
Expand Up @@ -699,7 +699,7 @@ public String getProperty(String name) {
* @see #getProperty(String)
*/
public void setProperty(String name, String value) {
// Create the property hashtable only when a property is set for the first time
// create the property hashtable only when a property is set for the first time
if(properties==null)
properties = new HashMap<>();

Expand Down Expand Up @@ -977,7 +977,7 @@ public String toString() {
*/
@Override
public Object clone() {
// Create a new FileURL return it, instead of using Object.clone() which is probably way slower;
// create a new FileURL return it, instead of using Object.clone() which is probably way slower;
// most FileURL fields are immutable and as such reused in cloned instance
FileURL clonedURL = new FileURL(handler);

Expand Down
Expand Up @@ -59,7 +59,7 @@ public OutputStream createEntry(String entryPath, FileAttributes attributes) thr

boolean isDirectory = attributes.isDirectory();

// Create the entry
// create the entry
TarEntry entry = new TarEntry(normalizePath(entryPath, isDirectory));
// Use provided file's size (required by TarOutputStream) and date
long size = attributes.getSize();
Expand Down
Expand Up @@ -70,7 +70,7 @@ public OutputStream createEntry(String entryPath, FileAttributes attributes) thr

boolean isDirectory = attributes.isDirectory();

// Create the entry and use the provided file's date
// create the entry and use the provided file's date
ZipEntry entry = new ZipEntry(normalizePath(entryPath, isDirectory));
// Use provided file's size and date
long size = attributes.getSize();
Expand Down
Expand Up @@ -24,13 +24,13 @@
* <code>AttributeFileFilter</code> matches files which have a specific attribute set.
* Here's a list of supported file attributes:
* <ul>
* <li>{@link #DIRECTORY}</li>
* <li>{@link #FILE}</li>
* <li>{@link #BROWSABLE}</li>
* <li>{@link #ARCHIVE}</li>
* <li>{@link #SYMLINK}</li>
* <li>{@link #HIDDEN}</li>
* <li>{@link #ROOT}</li>
* <li>{@link FileAttribute#DIRECTORY}</li>
* <li>{@link FileAttribute#FILE}</li>
* <li>{@link FileAttribute#BROWSABLE}</li>
* <li>{@link FileAttribute#ARCHIVE}</li>
* <li>{@link FileAttribute#SYMLINK}</li>
* <li>{@link FileAttribute#HIDDEN}</li>
* <li>{@link FileAttribute#ROOT}</li>
* </ul>
*
* <p>Only one attribute can be matched at a time. To match several attributes, combine them using a
Expand Down

0 comments on commit 89985ef

Please sign in to comment.