Update qrc's for new Icons and update Import Script
[quassel.git] / icons / import / import_theme.pl
index cea05c8..8e56c27 100755 (executable)
 # NOTE: Unless you are a Quassel developer and need to bump the icons we ship, you shouldn't
 #       need to use this script!
 
-# USAGE: ./import/import_theme.pl $systhemefolder $themename
+# USAGE: ./import/import_theme.pl $systhemefolder $themename $parentFolderFileSuffix
 # Run from the icon/ directory.
+#
+# Examples: (being inside the icons folder)
+# ./import/import_theme.pl ~/oxygen-icons oxygen
+# ./import/import_theme.pl ~/breeze-icons/icons breeze ICONS
+# ./import/import_theme.pl ~/breeze-icons/icons-dark breezedark ICONS
 
 use strict;
 use warnings;
@@ -24,17 +29,16 @@ my $source = "../src";
 my $themename = shift;
 $themename = $themename ? $themename : "oxygen";
 my $qrcfile_kde = $themename . ".qrc";
+my $parentFolderFileSuffix = shift;
 
 my $whitelistfile = "import/whitelist-icons";
 my $blacklistfile = "import/blacklisted-icons";
-my $extrafile = "import/extra-icons.qrc." . $themename;
 
 my %req_icons;
 my %found_icons;
 my %blacklist;
 my %themeblacklist;
 my %whitelist;
-my $extrafilecontent;
 
 # First, load the icon blacklist
 open BLACKLIST, "<$blacklistfile" or die "Could not open $blacklistfile\n";
@@ -78,18 +82,6 @@ while(<WHITELIST>) {
 }
 close WHITELIST;
 
-# Read in extra-icons
-my $hasthemeextrafile = 1;
-local $/;
-open EXTRAFILE, "<$extrafile" or $hasthemeextrafile = 0;
-if($hasthemeextrafile) {
-  binmode EXTRAFILE;
-  $extrafilecontent = <EXTRAFILE>;
-  close EXTRAFILE;
-} else {
-  $extrafilecontent = "";
-}
-
 # Clean old output dir
 print "Removing old $themename...\n";
 system("rm -rf $themename");
@@ -147,6 +139,10 @@ foreach my $icon (keys %req_icons) {
 # Copy license etc.
 system "cp $themefolder/AUTHORS $themefolder/CONTRIBUTING $themefolder/COPYING* $themefolder/index.theme $themename/";
 
+if($parentFolderFileSuffix) {
+       system "cp $themefolder/../AUTHORS*$parentFolderFileSuffix $themefolder/../CONTRIBUTING*$parentFolderFileSuffix $themefolder/../COPYING*$parentFolderFileSuffix $themename/";
+}
+
 # Generate .qrc
 my @file_list;
 generate_qrc($themename, $qrcfile_kde, $extrafilecontent);
@@ -166,7 +162,6 @@ sub generate_qrc {
   my $qrc = "<RCC>\n"
            ."  <qresource prefix=\"/icons\">\n"
            ."$files\n"
-           ."$extrafilecontent\n"
            ."  </qresource>\n"
            ."</RCC>\n";