Skip to content

Commit

Permalink
replaced some icons
Browse files Browse the repository at this point in the history
minor code refactor
fixed some minor issues (send by email and others
)
  • Loading branch information
trol73 committed Dec 28, 2016
1 parent a2113ec commit 23bbd88
Show file tree
Hide file tree
Showing 135 changed files with 590 additions and 734 deletions.
Binary file modified res/runtime/images/action/CloseWindow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/runtime/images/action/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/action/Delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/action/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/action/GoBack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/action/[email protected]
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/action/GoForward.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/action/[email protected]
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/action/GoToParent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/action/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/action/Move.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/runtime/images/action/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/action/PermanentDelete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/runtime/images/action/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/action/Rename.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/runtime/images/action/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/action/View.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/runtime/images/action/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/runtime/images/file/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/file/network.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/runtime/images/file/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/preferences/appearance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/runtime/images/preferences/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/preferences/folders.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/runtime/images/preferences/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/runtime/images/preferences/general.png
Binary file added res/runtime/images/preferences/[email protected]
Binary file modified res/runtime/images/preferences/mail.png
Binary file modified res/runtime/images/preferences/misc.png
Binary file added res/runtime/images/preferences/[email protected]
Binary file modified res/runtime/images/preferences/shortcuts.png
Binary file added res/runtime/images/preferences/[email protected]
Binary file modified res/runtime/images/status_bar/trash.png
Binary file added res/runtime/images/status_bar/[email protected]
1 change: 0 additions & 1 deletion src/main/com/mucommander/PlatformManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.io.File;
import java.io.IOException;

import com.mucommander.profiler.Profiler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
1 change: 0 additions & 1 deletion src/main/com/mucommander/adb/AdbUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import com.mucommander.commons.file.AbstractFile;
import com.mucommander.commons.file.FileFactory;
import com.mucommander.commons.file.impl.local.LocalFile;
import com.mucommander.commons.runtime.OsFamily;
import com.mucommander.process.ExecutionFinishListener;
import com.mucommander.process.ExecutorUtils;
Expand Down
23 changes: 12 additions & 11 deletions src/main/com/mucommander/auth/CredentialsConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,37 @@
interface CredentialsConstants {

/** Root element */
static final String ELEMENT_ROOT = "credentials_list";
String ELEMENT_ROOT = "credentials_list";

/** Element for each credential item, containg a URL, login and password */
static final String ELEMENT_CREDENTIALS = "credentials";
String ELEMENT_CREDENTIALS = "credentials";

/** Element containing the credentials' URL */
static final String ELEMENT_URL = "url";
String ELEMENT_URL = "url";

/** Element containing the credentials' login */
static final String ELEMENT_LOGIN = "login";
String ELEMENT_LOGIN = "login";

/** Element containing the credentials' (encrypted) password*/
static final String ELEMENT_PASSWORD = "password";
String ELEMENT_PASSWORD = "password";

/** Element that defines a property (name/value pair) */
static final String ELEMENT_PROPERTY = "property";
String ELEMENT_PROPERTY = "property";

/** Name attribute of the property element */
static final String ATTRIBUTE_NAME = "name";

String ATTRIBUTE_NAME = "name";

/** Value attribute of the property element */
static final String ATTRIBUTE_VALUE = "value";
String ATTRIBUTE_VALUE = "value";

/** Name of the root element's attribute containing the muCommander version that was used to create the credentials file */
static final String ATTRIBUTE_VERSION = "version";
String ATTRIBUTE_VERSION = "version";

/** Root element's attribute containing the encryption method used for passwords */
static final String ATTRIBUTE_ENCRYPTION = "encryption";
String ATTRIBUTE_ENCRYPTION = "encryption";

/** Weak password encryption method */
static final String WEAK_ENCRYPTION_METHOD = "weak";
String WEAK_ENCRYPTION_METHOD = "weak";

}
5 changes: 2 additions & 3 deletions src/main/com/mucommander/auth/CredentialsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,12 @@ public static void writeCredentials(boolean forceWrite) throws IOException {
credentialsFile = getCredentialsFile();
CredentialsWriter.write(out = new BackupOutputStream(credentialsFile));
saveNeeded = false;
}
finally {
} finally {
if (out != null) {
// TODO autoclosable
try {
out.close();
} catch(Exception e) {}
} catch(Exception ignore) {}
}
}

Expand Down
17 changes: 6 additions & 11 deletions src/main/com/mucommander/bonjour/BonjourDirectory.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,24 +158,19 @@ public void serviceAdded(final ServiceEvent serviceEvent) {
getLogger().trace("name="+serviceEvent.getName()+" type="+serviceEvent.getType());

// Ignore if Bonjour has been disabled
if(!isActive())
if (!isActive()) {
return;

}
// Resolve service info in a separate thread, serviceResolved() will be called once service info has been resolved.
// Not spawning a thread often leads to service info loss (serviceResolved() not called).
new Thread() {
@Override
public void run() {
jmDNS.requestServiceInfo(serviceEvent.getType(), serviceEvent.getName(), SERVICE_RESOLUTION_TIMEOUT);
}
}.start();
new Thread(() -> jmDNS.requestServiceInfo(serviceEvent.getType(), serviceEvent.getName(), SERVICE_RESOLUTION_TIMEOUT)).start();
}

public void serviceResolved(ServiceEvent serviceEvent) {
getLogger().trace("name="+serviceEvent.getName()+" type="+serviceEvent.getType()+" info="+serviceEvent.getInfo());

// Ignore if Bonjour has been disabled
if(!isActive())
if (!isActive())
return;

// Creates a new BonjourService corresponding to the new service and add it to the list of current Bonjour services
Expand Down Expand Up @@ -209,7 +204,7 @@ public void serviceRemoved(ServiceEvent serviceEvent) {
// the list of current Bonjour services.
// ServiceInfo should be available in JmDNS's cache.
ServiceInfo serviceInfo = jmDNS.getServiceInfo(serviceEvent.getType(), serviceEvent.getName());
if(serviceInfo!=null) {
if (serviceInfo != null) {
if(serviceInfo.getInetAddress() instanceof Inet6Address) {
// IPv6 addresses not supported at this time + they seem not to be correctly handled by ServiceInfo
getLogger().debug("ignoring IPv6 service");
Expand All @@ -220,7 +215,7 @@ public void serviceRemoved(ServiceEvent serviceEvent) {
// Synchronized to properly handle duplicate calls
synchronized(instance) {
// Note: BonjourService#equals() uses the service's fully qualified name as the discriminator.
if(bs!=null && services.contains(bs)) {
if (bs != null && services.contains(bs)) {
getLogger().debug("BonjourService "+bs+" removed");
services.remove(bs);
}
Expand Down
20 changes: 11 additions & 9 deletions src/main/com/mucommander/command/PermissionsFileFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.mucommander.commons.file.PermissionAccesses;
import com.mucommander.commons.file.PermissionTypes;
import com.mucommander.commons.file.filter.AbstractFileFilter;
import com.mucommander.commons.runtime.JavaVersion;

/**
* Filter on a file's permissions.
Expand All @@ -37,28 +36,31 @@ public class PermissionsFileFilter extends AbstractFileFilter implements Permiss
* @param permission permission that will be checked against as defined in {@link com.mucommander.commons.file.FilePermissions}.
* @param filter whether or not the specified permission flag must be set for a file to be accepted.
*/
public PermissionsFileFilter(int permission, boolean filter) {
PermissionsFileFilter(int permission, boolean filter) {
this.permission = permission;
this.filter = filter;
this.filter = filter;
}

public boolean accept(AbstractFile file) {
if(permission== EXECUTE_PERMISSION && JavaVersion.JAVA_1_5.isCurrentOrLower())
return true;

return filter ? file.getPermissions().getBitValue(USER_ACCESS, permission) : !file.getPermissions().getBitValue(USER_ACCESS, permission);
// if(permission== EXECUTE_PERMISSION && JavaVersion.JAVA_1_5.isCurrentOrLower())
// return true;
return filter == file.getPermissions().getBitValue(USER_ACCESS, permission);
}

/**
* Returns the permission that this IMAGE_FILTER will check.
* @return the permission that this IMAGE_FILTER will check.
*/
public int getPermission() {return permission;}
public int getPermission() {
return permission;
}

/**
* Returns <code>true</code> if files must have the IMAGE_FILTER's permission flag set in order to be accepted.
* @return <code>true</code> if files must have the IMAGE_FILTER's permission flag set in order to be accepted, <code>false</code> otherwise.
*/
public boolean getFilter() {return filter;}
public boolean getFilter() {
return filter;
}
}

4 changes: 2 additions & 2 deletions src/main/com/mucommander/commons/file/AbstractFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ public long getLastAccessDate() throws IOException {
* -- {@link #isFileOperationSupported(FileOperation)} can be called to find out if it is. If the operation isn't
* supported, a {@link UnsupportedFileOperation} will be thrown when this method is called.
*
* @return an <code>OuputStream</code> to write the contents of this file
* @return an <code>OutputStream</code> to write the contents of this file
* @throws IOException in any of the cases listed above
* @throws UnsupportedFileOperationException if this operation is not supported by the underlying filesystem,
* or is not implemented.
Expand All @@ -1816,7 +1816,7 @@ public long getLastAccessDate() throws IOException {
* -- {@link #isFileOperationSupported(FileOperation)} can be called to find out if it is. If the operation isn't
* supported, a {@link UnsupportedFileOperation} will be thrown when this method is called.
*
* @return an <code>OuputStream</code> to write the contents of this file
* @return an <code>OutputStream</code> to write the contents of this file
* @throws IOException in any of the cases listed above
* @throws UnsupportedFileOperationException if this operation is not supported by the underlying filesystem,
* or is not implemented.
Expand Down
2 changes: 1 addition & 1 deletion src/main/com/mucommander/commons/file/FileFactory.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* This file is part of muCommander, http://www.mucommander.com
* Copyright (C) 2002-2010 Maxence Bernard
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,33 +84,30 @@ public InputStream getEntryInputStream(ArchiveEntry entry, ArchiveEntryIterator
final int[] in = new int[1];
in[0] = (Integer)entry.getEntryObject();
final CircularByteBuffer cbb = new CircularByteBuffer(CircularByteBuffer.INFINITE_SIZE);
new Thread() {
@Override
public void run() {
synchronized (SevenZipJBindingROArchiveFile.this) {
try {
final IInArchive sevenZipFile = openInArchive();
sevenZipFile.extract(in, false, new ExtractCallback(inArchive, cbb.getOutputStream()));
} catch (IOException e) {
e.printStackTrace();
} finally {
if (inArchive != null) {
try {
inArchive.close();
} catch (SevenZipException e) {
e.printStackTrace();
}
}
new Thread(() -> {
synchronized (SevenZipJBindingROArchiveFile.this) {
try {
final IInArchive sevenZipFile = openInArchive();
sevenZipFile.extract(in, false, new ExtractCallback(inArchive, cbb.getOutputStream()));
} catch (IOException e) {
e.printStackTrace();
} finally {
if (inArchive != null) {
try {
cbb.getOutputStream().close();
} catch (IOException e) {
inArchive.close();
} catch (SevenZipException e) {
e.printStackTrace();
}
inArchive = null;
}
try {
cbb.getOutputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
inArchive = null;
}
}
}.start();
}).start();

return cbb.getInputStream();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@
import com.mucommander.commons.file.impl.sevenzip.provider.SevenZip.ICodeProgress;
import com.mucommander.commons.file.impl.sevenzip.provider.SevenZip.Compression.RangeCoder.BitTreeEncoder;

public class Encoder
{
public static final int EMatchFinderTypeBT2 = 0;
public static final int EMatchFinderTypeBT4 = 1;
public class Encoder {
private static final int EMatchFinderTypeBT2 = 0;
private static final int EMatchFinderTypeBT4 = 1;




static final int kIfinityPrice = 0xFFFFFFF;
static final int kInfinityPrice = 0xFFFFFFF;

static byte[] g_FastPos = new byte[1 << 11];

static
{
static {
int kFastSlots = 22;
int c = 2;
g_FastPos[0] = 0;
Expand All @@ -31,8 +26,7 @@ public class Encoder
}
}

static int GetPosSlot(int pos)
{
static int GetPosSlot(int pos) {
if (pos < (1 << 11))
return g_FastPos[pos];
if (pos < (1 << 21))
Expand Down Expand Up @@ -74,7 +68,7 @@ class Encoder2



public void Encode(com.mucommander.commons.file.impl.sevenzip.provider.SevenZip.Compression.RangeCoder.Encoder rangeEncoder, byte symbol) throws IOException
void Encode(com.mucommander.commons.file.impl.sevenzip.provider.SevenZip.Compression.RangeCoder.Encoder rangeEncoder, byte symbol) throws IOException
{
int context = 1;
for (int i = 7; i >= 0; i--)
Expand All @@ -85,7 +79,7 @@ public void Encode(com.mucommander.commons.file.impl.sevenzip.provider.SevenZip.
}
}

public void EncodeMatched(com.mucommander.commons.file.impl.sevenzip.provider.SevenZip.Compression.RangeCoder.Encoder rangeEncoder, byte matchByte, byte symbol) throws IOException
void EncodeMatched(com.mucommander.commons.file.impl.sevenzip.provider.SevenZip.Compression.RangeCoder.Encoder rangeEncoder, byte matchByte, byte symbol) throws IOException
{
int context = 1;
boolean same = true;
Expand Down Expand Up @@ -638,7 +632,7 @@ int GetOptimum(int position) throws IOException

int len = lenEnd;
do
_optimum[len--].Price = kIfinityPrice;
_optimum[len--].Price = kInfinityPrice;
while (len >= 2);

for (i = 0; i < Base.kNumRepDistances; i++)
Expand Down Expand Up @@ -859,7 +853,7 @@ else if (pos == 2)
{
int offset = cur + 1 + lenTest2;
while (lenEnd < offset)
_optimum[++lenEnd].Price = kIfinityPrice;
_optimum[++lenEnd].Price = kInfinityPrice;
int curAndLenPrice = nextRepMatchPrice + GetRepPrice(
0, lenTest2, state2, posStateNext);
Optimal optimum = _optimum[offset];
Expand All @@ -886,7 +880,7 @@ else if (pos == 2)
do
{
while (lenEnd < cur + lenTest)
_optimum[++lenEnd].Price = kIfinityPrice;
_optimum[++lenEnd].Price = kInfinityPrice;
int curAndLenPrice = repMatchPrice + GetRepPrice(repIndex, lenTest, state, posState);
Optimal optimum = _optimum[cur + lenTest];
if (curAndLenPrice < optimum.Price)
Expand Down Expand Up @@ -929,7 +923,7 @@ else if (pos == 2)
{
int offset = lenTest + 1 + lenTest2;
while (lenEnd < cur + offset)
_optimum[++lenEnd].Price = kIfinityPrice;
_optimum[++lenEnd].Price = kInfinityPrice;
int curAndLenPrice = nextRepMatchPrice + GetRepPrice(0, lenTest2, state2, posStateNext);
Optimal optimum = _optimum[cur + offset];
if (curAndLenPrice < optimum.Price)
Expand Down Expand Up @@ -958,7 +952,7 @@ else if (pos == 2)
{
normalMatchPrice = matchPrice + com.mucommander.commons.file.impl.sevenzip.provider.SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isRep[state]);
while (lenEnd < cur + newLen)
_optimum[++lenEnd].Price = kIfinityPrice;
_optimum[++lenEnd].Price = kInfinityPrice;

int offs = 0;
while (startLen > _matchDistances[offs])
Expand Down Expand Up @@ -1002,7 +996,7 @@ else if (pos == 2)

int offset = lenTest + 1 + lenTest2;
while (lenEnd < cur + offset)
_optimum[++lenEnd].Price = kIfinityPrice;
_optimum[++lenEnd].Price = kInfinityPrice;
curAndLenPrice = nextRepMatchPrice + GetRepPrice(0, lenTest2, state2, posStateNext);
optimum = _optimum[cur + offset];
if (curAndLenPrice < optimum.Price)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import com.sshtools.ssh.*;
import com.sshtools.ssh.components.SshKeyPair;
import com.sshtools.ssh2.*;
import com.sshtools.ssh.components.SshPrivateKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.mucommander.commons.file.connection.ConnectionHandler;
import com.mucommander.commons.file.connection.ConnectionPool;
import com.mucommander.commons.io.*;
import com.sshtools.sftp.SftpFileAttributes;
import com.sshtools.sftp.*;
import com.sshtools.ssh.SshException;
import com.sshtools.util.UnsignedInteger32;
Expand Down
Loading

0 comments on commit 23bbd88

Please sign in to comment.