Add an IntelliJ settings file describing the Dolphin project code style.
This commit is contained in:
parent
abaf41baa7
commit
f3aec526b1
|
@ -3,7 +3,6 @@
|
|||
If you make any contributions to Dolphin after December 1st, 2014, you are agreeing that any code you have contributed will be licensed under the GNU GPL version 2 (or any later version).
|
||||
|
||||
## Coding Style
|
||||
---
|
||||
|
||||
- [Introduction] (#introduction)
|
||||
- [Styling and formatting] (#styling-and-formatting)
|
||||
|
@ -20,14 +19,12 @@ If you make any contributions to Dolphin after December 1st, 2014, you are agree
|
|||
|
||||
|
||||
## Introduction
|
||||
---
|
||||
|
||||
This guide is for developers who wish to contribute to the Dolphin codebase. It will detail how to properly style and format code to fit this project. This guide also offers suggestions on specific functions and other varia that may be used in code.
|
||||
|
||||
Following this guide and formatting your code as detailed will likely get your pull request merged much faster than if you don't (assuming the written code has no mistakes in itself).
|
||||
|
||||
## Styling and formatting
|
||||
---
|
||||
|
||||
### General
|
||||
- Try to limit lines of code to a maximum of 100 characters.
|
||||
|
@ -130,7 +127,6 @@ private:
|
|||
```
|
||||
|
||||
## Code Specific
|
||||
---
|
||||
|
||||
### General
|
||||
- Using C++11 features is OK and recommended.
|
||||
|
@ -229,3 +225,7 @@ private:
|
|||
// Class definitions
|
||||
};
|
||||
```
|
||||
|
||||
## Java
|
||||
|
||||
The Android project is currently written in Java. If you are using Android Studio to contribute, you can import the project's code style from `code-style-java.jar`, located in `[Dolphin Root]/Source/Android`. Please organize imports before committing.
|
|
@ -30,7 +30,6 @@
|
|||
android:theme="@style/DolphinWii"
|
||||
android:label="@string/add_directory_title"/>
|
||||
|
||||
|
||||
<activity
|
||||
android:name="org.dolphinemu.dolphinemu.gamelist.GameListActivity"
|
||||
android:label="@string/app_name"
|
||||
|
|
|
@ -125,7 +125,8 @@ public class FileAdapter extends RecyclerView.Adapter<FileViewHolder> implements
|
|||
if (fileList.isEmpty())
|
||||
{
|
||||
Toast.makeText(view.getContext(), R.string.add_directory_empty_folder, Toast.LENGTH_SHORT).show();
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
// Delay the loading of the new directory to give a little bit of time for UI feedback
|
||||
// to happen. Hacky, but good enough for now; this is necessary because we're modifying
|
||||
|
@ -141,7 +142,8 @@ public class FileAdapter extends RecyclerView.Adapter<FileViewHolder> implements
|
|||
}
|
||||
}, 200);
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pass the activity the path of the parent directory of the clicked file.
|
||||
mListener.finishSuccessfully();
|
||||
|
|
|
@ -26,7 +26,8 @@ public class FileListItem implements Comparable<FileListItem>
|
|||
if (file.isDirectory())
|
||||
{
|
||||
mType = TYPE_FOLDER;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
String fileExtension = mPath.substring(mPath.lastIndexOf('.'));
|
||||
|
||||
|
@ -37,7 +38,8 @@ public class FileListItem implements Comparable<FileListItem>
|
|||
if (allowedExtensions.contains(fileExtension))
|
||||
{
|
||||
mType = NativeLibrary.IsWiiTitle(mPath) ? TYPE_WII : TYPE_GC;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
mType = TYPE_OTHER;
|
||||
}
|
||||
|
@ -67,12 +69,14 @@ public class FileListItem implements Comparable<FileListItem>
|
|||
if (theOther.getType() == getType())
|
||||
{
|
||||
return getFilename().toLowerCase().compareTo(theOther.getFilename().toLowerCase());
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (getType() > theOther.getType())
|
||||
{
|
||||
return 1;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue