Review of "PasteBin" version 2

Details Page Preview

A quick paste bin (notepad) in the top bar. Stores text locally and allows copying/pasting to the system clipboard.

Extension Homepage
https://github.com/giantturtle/pastebin-extension

No comments.

Diff Against

Files

Note: Binary files aren't shown on the web site. To see all files, please download the extension zipfile.

Shexli (experimental) error 1 warning 3 manual_review 1

Shexli found 5 issues that may need reviewer attention.

EGO-X-004 warning

extensions should avoid synchronous file IO in shell code

Shell code should avoid synchronous file IO APIs like `GLib.file_get_contents()` and `Gio.File.load_contents()`.

File Operations

  • extension.js:304
    GLib.file_get_contents(this._cacheFile)

EGO-A-005 manual_review

extensions should not access the clipboard directly

Direct clipboard access via `St.Clipboard.get_default()` requires reviewer scrutiny.

Review Guidelines

  • extension.js:111
    St.Clipboard.get_default()
  • extension.js:116
    St.Clipboard.get_default()
  • extension.js:157
    St.Clipboard.get_default()
  • extension.js:172
    St.Clipboard.get_default()

EGO-P-003 error

GSettings schema XML must be present in package

Extension appears to use GSettings but no `.gschema.xml` file is included in the package.

GSettings Schemas

EGO-L-003 warning

signals connected by extension should be disconnected in disable()

Signals assigned in `enable()` are missing matching disconnect calls in `disable()` or its helper methods.

Disconnect all signals

  • extension.js:90
    this._gtkThemeSignalId = this._settings.connect('changed::gtk-theme', () => this._syncTheme())
  • extension.js:89
    this._themeSignalId = this._settings.connect('changed::color-scheme', () => this._syncTheme())
  • extension.js:177
                this.btnClear.connect('clicked', () => {
                    this.entry.text = '';
                    this._scheduleSave();
                })
  • extension.js:169
                this.btnCopy.connect('clicked', () => {
                    let textToCopy = this.entry.get_selection();
                    if (!textToCopy) textToCopy = this.entry.text;
                    St.Clipboard.get_default().set_text(St.ClipboardType.CLIPBOARD, textToCopy);
                })
  • extension.js:156
                this.btnPaste.connect('clicked', () => {
                    St.Clipboard.get_default().get_text(St.ClipboardType.CLIPBOARD, (clip, text) => {
                        if (text) {
                            this.entry.delete_selection();
                            let pos = this.entry.get_cursor_positi
  • extension.js:96
                this.entry.connect('key-press-event', (actor, event) => {
                    let symbol = event.get_key_symbol();
                    let state = event.get_state();
                    let ctrl = (state & Clutter.ModifierType.CONTROL_MASK);
    
                    if (symbol === Clutter.KEY_Return || symb
  • extension.js:188
    this.entry.connect('text-changed', () => this._scheduleSave())
  • extension.js:190
                this.menu.connect('open-state-changed', (menu, open) => {
                    if (open) {
                        this._syncTheme();
                        if (this._timeoutId) {
                            GLib.source_remove(this._timeoutId);
                        }
                        this._timeoutId =
  • extension.js:66
                this.textContainer.connect('button-press-event', () => {
                    global.stage.set_key_focus(this.entry);
                    return Clutter.EVENT_STOP;
                })

EGO-L-004 warning

main loop sources should be removed in disable()

Main loop sources assigned in `enable()` are missing matching removals in `disable()` or its helper methods.

Remove main loop sources

  • extension.js:286
                this._saveTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1000, () => {
                    this._saveText();
                    this._saveTimeoutId = null;
                    return GLib.SOURCE_REMOVE;
                })
  • extension.js:196
                        this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 50, () => {
                            global.stage.set_key_focus(this.entry);
                            this._timeoutId = 0;
                            return GLib.SOURCE_REMOVE;
                        })

All Versions

Version Status
2 Unreviewed
1 Active

Previous Reviews on this Version

GiantTurtle posted a review
Version 2