OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkDebuggerGUI.h" | 8 #include "SkDebuggerGUI.h" |
9 #include "SkForceLinking.h" | 9 #include "SkForceLinking.h" |
10 #include "SkGraphics.h" | 10 #include "SkGraphics.h" |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 SkASSERT(commands->count() == offsets->count()); | 805 SkASSERT(commands->count() == offsets->count()); |
806 fListWidget.clear(); | 806 fListWidget.clear(); |
807 int counter = 0; | 807 int counter = 0; |
808 int indent = 0; | 808 int indent = 0; |
809 for (int i = 0; i < commands->count(); i++) { | 809 for (int i = 0; i < commands->count(); i++) { |
810 QListWidgetItem *item = new QListWidgetItem(); | 810 QListWidgetItem *item = new QListWidgetItem(); |
811 item->setData(Qt::DisplayRole, (*commands)[i].c_str()); | 811 item->setData(Qt::DisplayRole, (*commands)[i].c_str()); |
812 item->setData(Qt::UserRole + 1, counter++); | 812 item->setData(Qt::UserRole + 1, counter++); |
813 | 813 |
814 if (0 == strcmp("Restore", (*commands)[i].c_str()) || | 814 if (0 == strcmp("Restore", (*commands)[i].c_str()) || |
815 0 == strcmp("EndCommentGroup", (*commands)[i].c_str()) || | 815 0 == strcmp("EndCommentGroup", (*commands)[i].c_str())) { |
816 0 == strcmp("PopCull", (*commands)[i].c_str())) { | |
817 indent -= 10; | 816 indent -= 10; |
818 } | 817 } |
819 | 818 |
820 item->setData(Qt::UserRole + 3, indent); | 819 item->setData(Qt::UserRole + 3, indent); |
821 | 820 |
822 if (0 == strcmp("Save", (*commands)[i].c_str()) || | 821 if (0 == strcmp("Save", (*commands)[i].c_str()) || |
823 0 == strcmp("Save Layer", (*commands)[i].c_str()) || | 822 0 == strcmp("Save Layer", (*commands)[i].c_str()) || |
824 0 == strcmp("BeginCommentGroup", (*commands)[i].c_str()) || | 823 0 == strcmp("BeginCommentGroup", (*commands)[i].c_str())) { |
825 0 == strcmp("PushCull", (*commands)[i].c_str())) { | |
826 indent += 10; | 824 indent += 10; |
827 } | 825 } |
828 | 826 |
829 item->setData(Qt::UserRole + 4, -1); | 827 item->setData(Qt::UserRole + 4, -1); |
830 item->setData(Qt::UserRole + 5, (int)(*offsets)[i]); | 828 item->setData(Qt::UserRole + 5, (int)(*offsets)[i]); |
831 | 829 |
832 fListWidget.addItem(item); | 830 fListWidget.addItem(item); |
833 } | 831 } |
834 } | 832 } |
835 | 833 |
(...skipping 26 matching lines...) Expand all Loading... |
862 } | 860 } |
863 | 861 |
864 // NOTE(chudy): Makes first item unselectable. | 862 // NOTE(chudy): Makes first item unselectable. |
865 QStandardItemModel* model = qobject_cast<QStandardItemModel*>( | 863 QStandardItemModel* model = qobject_cast<QStandardItemModel*>( |
866 fFilter.model()); | 864 fFilter.model()); |
867 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(), | 865 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(), |
868 fFilter.rootModelIndex()); | 866 fFilter.rootModelIndex()); |
869 QStandardItem* firstItem = model->itemFromIndex(firstIndex); | 867 QStandardItem* firstItem = model->itemFromIndex(firstIndex); |
870 firstItem->setSelectable(false); | 868 firstItem->setSelectable(false); |
871 } | 869 } |
OLD | NEW |