62 Commits

Author SHA1 Message Date
Allan Odgaard
fb7c2cef3f Use NSUserDefaults’s specialized «type»ForKey: 2016-06-20 11:43:40 +02:00
Allan Odgaard
417193e089 Update link dependencies for all targets
Some targets were including headers from frameworks not specified in their link dependencies. For a clean build this could cause an issue because the header was not available at the time of building the target.

The updated link dependencies are also based on what a target’s tests require. Ideally tests would have separate link dependencies, but as we don’t want to maintain this manually, this will have to wait until the build system automatically handles link dependencies.

Currently the commit command uses constants from the CommitWindow framework but should actually not be linked with it. However, the optimizer will strip dead code, so it should not result in much if any difference in the resulting binary and does solve a build dependency issue.
2016-05-07 13:00:55 +02:00
Allan Odgaard
b55ef5b09a Save all xibs with Xcode 7.1 (7B91b)
This was done in an attempt to prevent the warning saying “This file is set to build for a version older than the project deployment target.”

Unfortunately saving all the xibs did not get rid of the warning, even though tehy are all set to have 10.7 as their build target.

The latest xib format does however remove about 10.000 lines of XML.
2015-10-26 23:26:17 +07:00
Allan Odgaard
ebf20acc20 Prefer CFBundleShortVersionString over CFBundleVersion 2014-11-10 09:01:05 +01:00
Allan Odgaard
52455f049e Enable truncation of status text in download window 2014-11-06 13:47:45 +01:00
Allan Odgaard
9831019a55 Save with Xcode 6.1 (6A1052d) 2014-11-06 13:42:22 +01:00
Allan Odgaard
2f1c4c05c4 Do not use ‘timeIntervalSinceNow’ with dates in the past
We previously negated the result but now we instead ask for [[NSDate date] timeIntervalSinceDate:startDate].
2014-08-21 16:07:23 +02:00
Allan Odgaard
603f06d2db Move version comparison out of s/w update framework 2014-04-25 16:55:31 +07:00
Allan Odgaard
1f0e3db472 Remove trailing zeroes from numeric literals
I mainly dislike the trailing zeroes because CGFloat used to be a float but 1.0 is a double (1.0f would be a float). So better to under-specify and let the compiler figure out the proper type.
2014-04-14 14:26:52 +07:00
Allan Odgaard
cf8f796053 Do not use va_start macro with variable reference
This is undefined according to the standard and is a warning with clang-503.0.38.
2014-03-13 20:51:15 +07:00
Allan Odgaard
1e11a30a53 Remove redundant storage keywords for @property
These were required prior to the new 64 bit run-time.
2014-03-05 16:39:54 +07:00
Allan Odgaard
c2397484b8 Use C++11 for loop
Majority of the edits done using the following ruby script:

    def update_loops(src)
      dst, cnt = '', 0

      block_indent, variable = nil, nil
      src.each_line do |line|
        if block_indent
          if line =~ /^#{block_indent}([{}\t])|^\t*$/
            block_indent = nil if $1 == '}'
            line = line.gsub(%r{ ([^a-z>]) \(\*#{variable}\) | \*#{variable}\b | \b#{variable}(->) }x) do
              $1.to_s + variable + ($2 == "->" ? "." : "")
            end
          else
            block_indent = nil
          end
        elsif line =~ /^(\t*)c?iterate\((\w+), (?!diacritics::make_range)(.*\))$/
          block_indent, variable = $1, $2
          line = "#$1for(auto const& #$2 : #$3\n"
          cnt += 1
        end
        dst << line
      end
      return dst, cnt
    end

    paths.each do |path|
      src = IO.read(path)

      cnt = 1
      while cnt != 0
        src, cnt = update_loops(src)
        STDERR << "#{path}: #{cnt}\n"
      end

      File.open(path, "w") { |io| io << src }
    end
2014-03-03 10:34:13 +07:00
Allan Odgaard
e4e80a946c Use std::make_shared 2013-09-03 12:27:20 +02:00
Allan Odgaard
bf1e92b865 Do not use global constructors for fixtures 2013-08-16 22:40:08 +02:00
Allan Odgaard
ee10f79ed4 Fix non-retaining Objective-C property
The ‘lastVersionDownloaded’ property used ‘assign’ (since it used to be an integer) which meant TextMate would likely crash when the property was read (and had a non-nil value), which it would, when TextMate did a version check after already having downloaded an update (but not yet installed and relaunched).

Also drop the atomic requirement of the ‘archive’ property since we no longer access it from multiple threads.
2013-08-03 11:54:52 +02:00
Allan Odgaard
8d51e930e3 Ensure version_less(NULL_STR, «any») → true 2013-08-02 16:21:21 +02:00
Allan Odgaard
33a47898e1 Remove revision field from version_info_t 2013-07-02 18:43:46 +02:00
Allan Odgaard
9adac35f86 Use complex version string during software update checks
While it is simpler to compare a monotonically increasing integer (the revision), we always use the semantic version string in the user interface, meaning that this version string should change together with the revision, which effectively means we are maintaing two version numbers.

We previously embedded the revision in the version string (2.0-alpha.$revision) but when going from alpha → beta, it would be nice to reset the visible counter, so that first beta becomes 2.0-beta.1, furthermore, test versions could benefit from a more descriptive version string, e.g. “2.0-alpha.9439.2+debug” would be the second (semi-public) debug build after “2.0-alpha.9439”.
2013-07-02 18:43:46 +02:00
Allan Odgaard
6c2ed2053d Trim version string received from server 2013-07-02 18:43:46 +02:00
Allan Odgaard
dc1a53aa38 Add code for comparing complex version strings 2013-07-02 18:43:46 +02:00
Allan Odgaard
8017428011 If deleting old version fails then move it to trash
We also add a time suffix to the old version so that if we fail to remove it, the user will not get (another) error when retrying the update.

Presumably fixes #991.
2013-05-26 13:32:46 +08:00
Allan Odgaard
b489687403 Disable AuthorizationExecuteWithPrivileges deprecation warning
The “proper” replacement for this API is to use the ServiceManagement framework’s SMJobBless() to bless our helper tool. In two of the three use-cases our helper tool is however regular shell commands, so it seems redundant to wrap these shell tools as helper tools we can install as launchd jobs.
2013-05-06 14:51:31 +07:00
Allan Odgaard
04963caf01 Remove use of deprecated method 2013-04-09 15:39:38 +07:00
Allan Odgaard
b8c81b4acf Fix software updater to not skip checking
Initially ‘downloadWindow’ was a property that was nil until we showed the download window, but now that the download window is re-used for downloading newer versions (incase a newer version appear before user does the “Install & Relaunch”) the fetching the property will return the window (and create it if not already created).
2013-03-28 22:01:40 +01:00
Allan Odgaard
e1e0e5a8a5 Re-use download window if already visible
This is useful if a new update arrives after TextMate has downloaded the previous update but before the user relaunched TextMate.

Fixes #909.
2013-03-19 16:24:56 +01:00
Allan Odgaard
769831f629 Use Objective-C literals 2013-03-19 15:49:18 +01:00
Allan Odgaard
aa35578c99 Make s/w update tests concurrent 2013-03-10 16:07:11 +01:00
Allan Odgaard
c65e0718e6 Show human readable version string
This is instead of only showing the revision, which lack semantic info such as ‘alpha’ and 2.0 versus 1.5.11.

We now also show the version after a successful download instead of just “Download Completed”.
2013-02-15 15:27:55 +01:00
Allan Odgaard
50a7c17dbd Use initializer list with path::join 2013-02-12 11:09:24 +01:00
Allan Odgaard
ad03811df0 Ensure session restore when relaunching
The user can manually disable session restore, which is undesired when relaunching due to a software update or installing a plug-in, so we now override the user’s choice for the new instance launched.
2013-02-11 14:21:22 +01:00
Allan Odgaard
b1f19e93f2 Corrupt archive → extracting archive
This is a more correct error.

Also write exit code and potential error from tar to stderr.
2013-01-29 21:47:40 +01:00
Allan Odgaard
d00b9b34aa Change how we update TextMate.app
We now keep the root folder and instead replace the inner Contents folder — hopefully this way LaunchServices won’t add the update as a new entry (causing duplicates to show up in the Open With menu).
2013-01-21 15:03:52 +01:00
Allan Odgaard
0208414672 Download s/w updates to cache folder
This should hopefully solve the issue with the (on some systems) fairly aggressive temp cleaner.

Also remove the archive incase the user cancels the update, now that we are extracting it to a less temporary location.
2013-01-21 15:03:52 +01:00
Allan Odgaard
47fa0f040c Use Objective-C literals for YES/NO 2013-01-02 01:46:48 +01:00
Allan Odgaard
df914261f4 Update code to std::thread with lambda 2012-12-30 03:00:53 +01:00
Allan Odgaard
09abc8eede Fix software update logic
It would previously not ask to update (but go directly to download) when doing a manual update check.
2012-12-24 14:09:41 +01:00
Allan Odgaard
601cf28366 Use the low priority dispatch queue for update checks
Presently mainly a semantic change, as the dispatch queues are mostly empty, but as we adopt GCD for more things, it’ll be more important to put background tasks in a queue with lower priority than the one handling user requested tasks.
2012-12-20 14:02:39 +01:00
Allan Odgaard
c7780d1392 Add placeholder text for “time remaining” 2012-12-20 14:02:39 +01:00
Allan Odgaard
cd78f6d29d Eliminate two instance variables 2012-12-20 14:02:39 +01:00
Allan Odgaard
bb38a193e2 Set window autosave name 2012-12-19 20:42:55 +01:00
Allan Odgaard
97ca44f8ad Use NSRunningApplication for application name 2012-12-19 19:42:45 +01:00
Allan Odgaard
f87a11f1bb Improve s/w update dialog text
A “Downgrade” button now appear if the version on the server is lower than the current one. This would e.g. happen if the user has upgraded to a nightly build and does a manual version check (for non-nightly builds).

If the version on the server is the same version as the one running, the user can make a “Redownload” button appear by holding down shift (⇧) when running the update check.
2012-12-19 19:42:45 +01:00
Allan Odgaard
0bac97c9ae Use GCD + blocks for s/w update download 2012-12-19 19:42:45 +01:00
Allan Odgaard
6969d7a98e Use GCD + blocks for s/w update check 2012-12-19 19:42:36 +01:00
Allan Odgaard
71be61cbbb Enable ARC by default
We now explicitly disable it for targets that hasn’t yet been upgraded to ARC. This way, it’s easier to get an overview of which targets hasn’t yet been upgraded and ensures new targets has ARC enabled.
2012-12-19 19:42:36 +01:00
Allan Odgaard
88358ccf26 ARC: Update SoftwareUpdate framework 2012-12-19 19:42:36 +01:00
Allan Odgaard
ed45e1a241 Handle download in s/w update singleton 2012-12-19 19:42:35 +01:00
Allan Odgaard
4a25c7b98d Refactor software update
Move logic out of DownloadWindowController.
2012-12-19 19:42:35 +01:00
Allan Odgaard
0834649011 Improve binding properties
Each property now correspond to exactly one aspect of the UI allowing us to remove the logic and use the class as a view.
2012-12-19 19:42:35 +01:00
Allan Odgaard
3fdb50aa23 Save with Xcode 4.5.2 (4G2008a) 2012-12-19 19:42:35 +01:00