Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • gnome-builder gnome-builder
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 151
    • Issues 151
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • gnome-buildergnome-builder
  • Merge requests
  • !296

new-file-popover: add check button to automatically trim whitespaces

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Mathieu PATUREL requested to merge math2001/gnome-builder:new-file-trim-whitespaces into master Aug 20, 2020
  • Overview 58
  • Commits 1
  • Pipelines 8
  • Changes 2

Fixes #1277 (closed)

I'm quite new to C, and manual memory management. But I'm pretty sure this is right. I'm just duplicating the text returned by gtk_entry_get_text who doesn't give ownership into a g_autofree gchar * to strip it. After, the variable isn't passed to anybody who'd take ownership of it at anypoint.

Also, the part where I'm checking the first and last characters could be done by stripping and then comparing length, but doing it this way makes it possible to save on allocation. It's probably not significant at all, but why not. The lines are very lengthy though, I don't know if/how they should be split up.

I noticed that gbp_new_file_popover_check_exists takes the argument directory. The current code doesn't require it however, it could just use self->directory no? The async code doesn't depend on it.

Edited Aug 20, 2020 by Mathieu PATUREL
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: new-file-trim-whitespaces